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:
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user