Routing
Methanol automatically constructs a routing hierarchy based on the structure of the pages/ directory.
MDX and Markdown Pages
pages/about.mdx→/aboutpages/guide/index.mdx→/guide/(directory index)
.html Pages
Plain HTML files can also be placed within the pages/ directory. These are included in the production build and processed by Vite:
pages/custom.html→dist/custom.html(accessible via/custom.html)
Example:
404 Page
Create pages/404.mdx to customize the "Not Found" page. This page is automatically hidden from the navigation menu.
Offline Page
Create pages/offline.mdx to customize the offline fallback page utilized by the built-in PWA. This page is also hidden from navigation by default.
Hidden vs. Excluded
hidden: true: Hides the page from navigation menus, though the route remains active and accessible via direct URL.exclude: true: Completely removes the page from both development and build processes. When applied to a directoryindex.mdx, the entire directory is excluded.- Files or directories beginning with
_or.are ignored by the system.