An MkDocs plugin that simplifies configuring page titles and their order through .pages configuration files
Build a small utility that previews the resolved navigation titles for a docs tree that uses distributed navigation metadata files. The utility should rely on the dependency to interpret .nav.yml files, directory names, and index.md frontmatter so the returned navigation matches what would be shown in the rendered site.
.nav.yml provides a title, the resolved navigation uses that value for the section even if the directory name or any index.md metadata differs. @test.nav.yml enables raw-name preservation for a directory, the section title matches the exact folder name and does not title-case or use metadata-derived titles. @testindex.md metadata for titles and no custom title or preservation rule is present, the navigation title comes from the title field in that frontmatter. @test@generates
from pathlib import Path
from typing import Literal
NavEntry = dict[str, str | Literal["section", "page"]]
def build_nav_titles(docs_root: str | Path) -> list[NavEntry]:
"""
Resolve navigation for the given docs_root using distributed navigation metadata and
return an ordered list of navigation entries.
Each entry contains:
- "title": the final display title for the item
- "path": the relative path from docs_root to the file or directory
- "kind": "section" for directories and "page" for Markdown files
"""Generates navigation from per-directory metadata files and applies title customization rules.
tessl i tessl/pypi-mkdocs-awesome-pages-plugin@2.10.0evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10