Links and Navigation
Methanol utilizes a file-based routing mechanism. Internal links can be created simply by referencing the route path of the target file.
Internal Links
Reference site routes without file extensions:
[Writing Basics](./writing)
Rendered result: Writing Basics
If a page is moved or renamed, ensure that any links pointing to it are updated accordingly.
Subpath Deployments (site.base)
If your site is hosted under a subpath (e.g., https://example.com/docs/), ensure site.base: '/docs/' is configured. In such cases, avoid using root-absolute links like /blog/post within your content.
Relative linking is recommended:
[Next post](./next-post)
[Back to blog](../blog/)
If you need to generate a root-absolute link within MDX or JSX, wrap the path with ctx.withBase:
<a href={ctx.withBase('/blog/post')}>Read</a>
External Links
For external destinations, use fully qualified URLs:
[Example](https://example.com)
Rendered result: Example
Navigation Hierarchy
Use Frontmatter properties to control the configured order and visibility of pages:
weight: Lower numerical values are positioned higher in the navigation.hidden: Excludes the page from the sidebar menu.isRoot: Defines anindex.mdxfile as the root of a navigation sub-tree.
For complete specifications, refer to the Frontmatter Reference.