Change Content and Index to create pretty urls
This commit is contained in:
@@ -42,7 +42,7 @@ class Content(Output):
|
||||
def build_path(section: str, slug: str) -> Path:
|
||||
if not Content._SECTION_RE.match(section):
|
||||
raise ContentError(f"Invalid section '{section}'")
|
||||
path = Path(f"{section}/{slug}.html")
|
||||
path = Path(f"{section}/{slug}/index.html")
|
||||
return path
|
||||
|
||||
def read_body(self) -> str:
|
||||
|
||||
@@ -44,7 +44,7 @@ class Index(Output):
|
||||
if page_num == 1:
|
||||
file = Path("index.html")
|
||||
else:
|
||||
file = Path(f"page-{page_num}.html")
|
||||
file = Path(f"page-{page_num}/index.html")
|
||||
|
||||
if kind == "root":
|
||||
path = file
|
||||
|
||||
Reference in New Issue
Block a user