Classes
SpecialPagesGenerator
Generates special pages like 404, search, etc.
These pages use templates from the theme but don't …
SpecialPagesGenerator
Generates special pages like 404, search, etc.
These pages use templates from the theme but don't have corresponding markdown source files. They need to be rendered during the build process to ensure they have proper styling and navigation.
Currently generates:
- 404.html: Custom 404 error page with site styling
- search.html: Client-side search page
- graph.html: Interactive knowledge graph visualization
Future:
- sitemap.html: Human-readable sitemap
Methods 1
generate
Generate all special pages that are enabled.
Currently generates:
- 404 page i…
generate
def generate(self, build_context: BuildContext | Any | None = None) -> None
Generate all special pages that are enabled.
Currently generates:
- 404 page if 404.html template exists in theme
- search page if enabled and template exists (and no user content overrides)
- graph visualization if enabled (and no user content overrides) Failures are logged but don't stop the build process.
Parameters 1
build_context |
BuildContext | Any | None |
Optional BuildContext with cached knowledge graph |
Internal Methods 4
__init__
Initialize special pages generator.
__init__
def __init__(self, site: Site) -> None
Initialize special pages generator.
Parameters 1
site |
Site |
Site instance with configuration and template engine |
_generate_404
Generate 404 error page with site styling.
Uses 404.html template from theme i…
_generate_404
def _generate_404(self) -> bool
Generate 404 error page with site styling.
Uses 404.html template from theme if it exists. Creates a minimal page context and renders the template with site navigation and styling.
Returns
True if generated successfully, False if template missing or error occurredbool
—
_generate_search
Generate client-side search page using theme/site template.
Behavior:
- Respec…
_generate_search
def _generate_search(self) -> bool
Generate client-side search page using theme/site template.
Behavior:
- Respects [search] config: enabled, path, template
- Skips if a user-authored content page exists that would handle /search/
- Skips if template is missing
- Writes to /search/index.html by default
Returns
bool
_generate_graph
Generate interactive knowledge graph visualization.
Behavior:
- Respects [grap…
_generate_graph
def _generate_graph(self, build_context: BuildContext | Any | None = None) -> bool
Generate interactive knowledge graph visualization.
Behavior:
- Respects [graph] config: enabled, path
- Skips if a user-authored content page exists that would handle /graph/
- Uses cached knowledge graph from build_context if available
- Writes to /graph/index.html by default
Parameters 1
build_context |
BuildContext | Any | None |
Optional BuildContext with cached knowledge graph |
Returns
True if generated successfully, False if disabled or error occurredbool
—