refactor: switch to flat .html output (suckless style)

- src/content.rs: output_path() now returns slug.html instead of
  slug/index.html for regular content.

- src/templates.rs: All hrefs use explicit .html extension.
  Nav links point to index.html, blog.index.html, about.html.
  Blog post links use ./slug.html format.

- src/main.rs: Adjust depth values (root=0, blog posts=1).

No more directory-per-page overhead. file:// navigation works
without directory listings. True suckless structure.
This commit is contained in:
Timothy DeHerrera
2026-01-24 21:36:58 -07:00
parent b9be21156d
commit 71d5ac1e37
3 changed files with 13 additions and 13 deletions

View File

@@ -75,7 +75,7 @@ impl Content {
}
/// Compute the output path relative to the output directory.
/// e.g., content/blog/foo.md → blog/foo/index.html
/// e.g., content/blog/foo.md → blog/foo.html
pub fn output_path(&self, content_root: &Path) -> PathBuf {
let relative = self
.source_path
@@ -84,14 +84,14 @@ impl Content {
match self.kind {
ContentKind::Section => {
// _index.md → parent/index.html
// _index.md → parent/index.html (listing pages stay as index.html)
let parent = relative.parent().unwrap_or(Path::new(""));
parent.join("index.html")
}
_ => {
// Regular content → parent/slug/index.html
// Regular content → parent/slug.html (flat structure)
let parent = relative.parent().unwrap_or(Path::new(""));
parent.join(&self.slug).join("index.html")
parent.join(format!("{}.html", self.slug))
}
}
}