Classes
PageNavigationMixin
Mixin providing navigation capabilities for pages.
This mixin handles:
- Site-level navigation: ne…
PageNavigationMixin
Mixin providing navigation capabilities for pages.
This mixin handles:
- Site-level navigation: next, prev
- Section-level navigation: next_in_section, prev_in_section
- Hierarchy: parent, ancestors
Attributes
| Name | Type | Description |
|---|---|---|
_site |
Any |
|
_section |
Section | None |
|
_section_path |
Path | None |
Methods 6
next
property
Get the next page in the site's collection of pages.
next
property def next(self) -> Page | None
Get the next page in the site's collection of pages.
Returns
Next page or None if this is the last pagePage | None
—
prev
property
Get the previous page in the site's collection of pages.
prev
property def prev(self) -> Page | None
Get the previous page in the site's collection of pages.
Returns
Previous page or None if this is the first pagePage | None
—
next_in_section
property
Get the next page within the same section, respecting weight order.
Pages are …
next_in_section
property def next_in_section(self) -> Page | None
Get the next page within the same section, respecting weight order.
Pages are ordered by weight (ascending), then alphabetically by title. Pages without weight are treated as weight=999999 (appear at end). Index pages (_index.md, index.md) are skipped in navigation.
Returns
Next page in section or None if this is the last pagePage | None
—
prev_in_section
property
Get the previous page within the same section, respecting weight order.
Pages …
prev_in_section
property def prev_in_section(self) -> Page | None
Get the previous page within the same section, respecting weight order.
Pages are ordered by weight (ascending), then alphabetically by title. Pages without weight are treated as weight=999999 (appear at end). Index pages (_index.md, index.md) are skipped in navigation.
Returns
Previous page in section or None if this is the first pagePage | None
—
parent
property
Get the parent section of this page.
parent
property def parent(self) -> Any | None
Get the parent section of this page.
Returns
Parent section or NoneAny | None
—
ancestors
property
Get all ancestor sections of this page.
ancestors
property def ancestors(self) -> list[Any]
Get all ancestor sections of this page.
Returns
List of ancestor sections from immediate parent to rootlist[Any]
—