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:
@@ -78,7 +78,7 @@ fn process_blog_posts(content_dir: &Path, output_dir: &Path) -> Result<Vec<Conte
|
||||
|
||||
let content = Content::from_path(path, ContentKind::Post)?;
|
||||
let html_body = render::markdown_to_html(&content.body);
|
||||
let page = templates::render_post(&content.frontmatter, &html_body, 2);
|
||||
let page = templates::render_post(&content.frontmatter, &html_body, 1);
|
||||
|
||||
write_output(output_dir, content_dir, &content, page.into_string())?;
|
||||
posts.push(content);
|
||||
@@ -117,7 +117,7 @@ fn process_pages(content_dir: &Path, output_dir: &Path) -> Result<()> {
|
||||
|
||||
let content = Content::from_path(&path, ContentKind::Page)?;
|
||||
let html_body = render::markdown_to_html(&content.body);
|
||||
let page = templates::render_page(&content.frontmatter, &html_body, 1);
|
||||
let page = templates::render_page(&content.frontmatter, &html_body, 0);
|
||||
|
||||
write_output(output_dir, content_dir, &content, page.into_string())?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user