feat: add docs landing page slug handling

- Add function to find first doc in sidebar
- Pass found doc ID to process_page
- Set slug: / for landing page in frontmatter
This commit is contained in:
Mahmoud-Emad
2025-12-01 11:54:02 +02:00
parent ed9ff35807
commit 8fc560ae78
17 changed files with 483 additions and 19 deletions

View File

@@ -93,7 +93,9 @@ fn from_category(cat NavCat) SidebarItem {
}
}
fn extract_page_id(id string) string {
// extract_page_id extracts the page name from a "collection:page_name" format.
// If the id doesn't contain a colon, returns the id as-is.
pub fn extract_page_id(id string) string {
parts := id.split(':')
if parts.len == 2 {
return parts[1]