Pages Index (methanol:pages)
The methanol:pages virtual module provides a list of all pages in your project, facilitating client-side features such as blog archives, category filters, and custom search interfaces.
import pages from 'methanol:pages'
// or
import { pages } from 'methanol:pages'
Included Content
Each entry in the index represents a page and its metadata. Heavy fields are automatically stripped to keep the bundle size small:
- Stripped fields:
content,mdxCtx, andgetSiblings. - Omitted values: Any function-type fields.
- Always included:
excerpt. If not explicitly defined in the frontmatter, Methanol generates one from the page content. - Exclusion: Hidden pages (
hidden: true) are omitted from the index.
The resulting objects contain metadata such as routePath, routeHref, title, frontmatter, stats, and excerpt.
Notes
- This module is designed strictly for client-side logic.
- In development mode, the index is automatically updated whenever pages are modified.