Links and Navigation

Methanol uses file-based routing. Link to pages using their route paths.

Use site routes (no file extension):

[Writing basics](./writing)

Renders as: Writing basics

If you move or rename a page, update the route in your links.

Subpath Deployments (site.base)

If your site is served under a subpath (for example https://example.com/docs/), set site.base: '/docs/' and avoid root-absolute internal links like /blog/post in your content.

Prefer relative links:

[Next post](./next-post)
[Back to blog](../blog/)

If you need to generate a root-absolute link in MDX/JSX, wrap it with ctx.withBase:

<a href={ctx.withBase('/blog/post')}>Read</a>

Use full URLs for external sites:

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

Renders as: Example

Use frontmatter fields to control order and visibility:

Full details are in the Frontmatter reference.