feat(nav): complete Tier 1 hierarchical navigation

Add config option [nav] nested (defaults false), update base.html
template with nested nav rendering, and add .nav-children CSS styling
for indented section children.

- Add NavConfig struct with nested: bool
- Template renders item.children in .nav-children div
- CSS: left border + indent for nested items
This commit is contained in:
Timothy DeHerrera
2026-02-01 09:04:15 -07:00
parent b3a540651a
commit 7f765b32e1
5 changed files with 41 additions and 2 deletions

View File

@@ -17,6 +17,17 @@ pub struct SiteConfig {
/// Path configuration (all optional with defaults).
#[serde(default)]
pub paths: PathsConfig,
/// Navigation configuration.
#[serde(default)]
pub nav: NavConfig,
}
/// Navigation configuration.
#[derive(Debug, Deserialize, Default)]
#[serde(default)]
pub struct NavConfig {
/// Whether to display nested navigation (default: false).
pub nested: bool,
}
/// Path configuration with sensible defaults.

View File

@@ -121,6 +121,8 @@ pub struct ConfigContext {
pub title: String,
pub author: String,
pub base_url: String,
/// Whether to display nested navigation
pub nested_nav: bool,
}
impl From<&SiteConfig> for ConfigContext {
@@ -129,6 +131,7 @@ impl From<&SiteConfig> for ConfigContext {
title: config.title.clone(),
author: config.author.clone(),
base_url: config.base_url.clone(),
nested_nav: config.nav.nested,
}
}
}