usePage
usePage exposes metadata extracted from the current Markdown or MDX page.
- Type:
() => { page: PageDataLegacy['page'] }
The page object contains parsed frontmatter and runtime details such as title, toc, lang, version, routePath, pagePath, description, headingTitle, pageType, and lastUpdatedTime, allowing you to build contextual UI for the active document.
Use
usePagetogether withuseSiteorusePageswhen you need both per-page metadata and global site information.