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.

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>

For external destinations, use fully qualified URLs:

[Example](https://example.com)

Rendered result: Example

Use Frontmatter properties to control the configured order and visibility of pages:

For complete specifications, refer to the Frontmatter Reference.