add directory normalization

This commit is contained in:
Daniel Fichtinger 2025-06-21 16:35:42 -04:00
parent b045739b45
commit 0b4de161b5
2 changed files with 11 additions and 3 deletions

View file

@ -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