add directory normalization
This commit is contained in:
parent
b045739b45
commit
0b4de161b5
2 changed files with 11 additions and 3 deletions
|
@ -44,7 +44,15 @@ def discover(root: Path, out_dir: Path) -> list[Item]:
|
|||
item.metadata, item.content = split_metadata(path)
|
||||
item.type = ItemType.MARKDOWN
|
||||
item.copy = False
|
||||
item.destination = destination.with_suffix(".html")
|
||||
name = destination.stem
|
||||
if name == "index":
|
||||
item.destination = item.destination.with_suffix(".html")
|
||||
else:
|
||||
relative = path.relative_to(base).with_suffix("")
|
||||
name = relative.stem
|
||||
item.destination = (
|
||||
out_dir / relative.parent / name / "index.html"
|
||||
)
|
||||
items.append(item)
|
||||
return items
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue