<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title>Methanol Docs</title><link href="https://methanol.sudomaker.com/"/><link rel="self" href="https://methanol.sudomaker.com/atom.xml"/><id>https://methanol.sudomaker.com/atom.xml</id><updated>2026-06-19T22:36:30.951Z</updated><generator>Methanol</generator><entry><title>Welcome</title><link href="https://methanol.sudomaker.com/"/><id>https://methanol.sudomaker.com/</id><summary>Overview of the Methanol documentation and core section indexes.</summary><content type="html">&lt;div style=&quot;padding-top: 35%&quot;&gt;&lt;/div&gt;
&lt;h1 id=&quot;welcome-to-methanol&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#welcome-to-methanol&quot; aria-label=&quot;Link to welcome-to-methanol&quot;&gt;&lt;/a&gt;Welcome to Methanol!&lt;/h1&gt;
&lt;div class=&quot;button-group button-group--left&quot;&gt;&lt;a class=&quot;link-button link-button--primary link-button--md&quot; href=&quot;./quick-start&quot;&gt;Get Started&lt;/a&gt;&lt;a class=&quot;link-button link-button--secondary link-button--md&quot; href=&quot;https://github.com/SudoMaker/Methanol&quot; target=&quot;_blank&quot;&gt;GitHub&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Methanol is an opinionated, fully customizable static site generator powered by &lt;a href=&quot;https://github.com/SudoMaker/rEFui&quot;&gt;rEFui&lt;/a&gt; and &lt;a href=&quot;https://mdxjs.com&quot;&gt;MDX&lt;/a&gt;. Designed for speed and clarity, it provides a streamlined environment for technical writing and creative ideas.&lt;/p&gt;
&lt;p&gt;Methanol requires nearly zero configuration: simply place your files in &lt;code&gt;pages/&lt;/code&gt; (or &lt;code&gt;docs/&lt;/code&gt;) to automatically generate routes, a homepage from &lt;code&gt;index.mdx&lt;/code&gt;, and a complete navigation tree.&lt;/p&gt;
&lt;h2 id=&quot;core-features&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#core-features&quot; aria-label=&quot;Link to core-features&quot;&gt;&lt;/a&gt;Core Features&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Automated Routing&lt;/strong&gt;: Drop MDX files into content directories and let Methanol handle the routing and navigation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Component Integration&lt;/strong&gt;: Author reusable JSX components in &lt;code&gt;components/&lt;/code&gt; and embed them directly within your Markdown.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fine-grained Control&lt;/strong&gt;: Manage navigation hierarchy, ordering, and visibility using standard frontmatter.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Production Ready&lt;/strong&gt;: Build to optimized static files in &lt;code&gt;dist/&lt;/code&gt; with built-in preview capabilities.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Extensible Pipeline&lt;/strong&gt;: Easily integrate &lt;a href=&quot;https://pagefind.app&quot;&gt;Pagefind&lt;/a&gt; for search and &lt;a href=&quot;https://github.com/wooorm/starry-night&quot;&gt;Starry Night&lt;/a&gt; for syntax highlighting.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;refui-html--islands&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#refui-html--islands&quot; aria-label=&quot;Link to refui-html--islands&quot;&gt;&lt;/a&gt;rEFui: HTML + Islands&lt;/h2&gt;
&lt;p&gt;Methanol leverages rEFui for both server-side HTML generation and client-side interactivity. The majority of your site is shipped as pure static HTML; only interactive client components are hydrated as isolated &amp;quot;islands&amp;quot; where necessary, avoiding the overhead of full-page hydration.&lt;/p&gt;</content><author><name>Yukino Song</name></author><updated>2026-06-19T22:36:06.586Z</updated></entry><entry><title>Quick Start</title><link href="https://methanol.sudomaker.com/quick-start"/><id>https://methanol.sudomaker.com/quick-start</id><summary>Project structure, core commands, and creating your first page in Methanol.</summary><content type="html">&lt;h1 id=&quot;quick-start&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#quick-start&quot; aria-label=&quot;Link to quick-start&quot;&gt;&lt;/a&gt;Quick Start&lt;/h1&gt;
&lt;p&gt;Methanol transforms a directory of Markdown and MDX files into a high-performance static site with automatic routing, navigation, and a robust build pipeline.&lt;/p&gt;
&lt;p&gt;Getting started is simple: create &lt;code&gt;pages/index.mdx&lt;/code&gt;, add your content, and Methanol will automatically build the routes and navigation tree.&lt;/p&gt;
&lt;h2 id=&quot;instant-preview&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#instant-preview&quot; aria-label=&quot;Link to instant-preview&quot;&gt;&lt;/a&gt;Instant Preview&lt;/h2&gt;
&lt;p&gt;Experience Methanol immediately by running the development server via &lt;code&gt;npx&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx methanol dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then, open &lt;code&gt;http://localhost:5173&lt;/code&gt; in your browser.&lt;/p&gt;
&lt;h2 id=&quot;using-an-existing-directory&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#using-an-existing-directory&quot; aria-label=&quot;Link to using-an-existing-directory&quot;&gt;&lt;/a&gt;Using an Existing Directory&lt;/h2&gt;
&lt;p&gt;If you already have a collection of Markdown or MDX files, point Methanol directly to that directory:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npx methanol dev ./my-docs
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The specified folder becomes the content root; for example, &lt;code&gt;./my-docs/index.mdx&lt;/code&gt; maps to the site root (&lt;code&gt;/&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id=&quot;installation&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#installation&quot; aria-label=&quot;Link to installation&quot;&gt;&lt;/a&gt;Installation&lt;/h2&gt;
&lt;p&gt;For frequent use, we recommend installing Methanol globally to benefit from faster CLI startup:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npm install methanol -g
methanol dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;production-workflow&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#production-workflow&quot; aria-label=&quot;Link to production-workflow&quot;&gt;&lt;/a&gt;Production Workflow&lt;/h2&gt;
&lt;p&gt;Generate an optimized production build and preview it locally:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;methanol build
methanol serve
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;serve&lt;/code&gt; command hosts the contents of the &lt;code&gt;dist/&lt;/code&gt; directory for final verification.&lt;/p&gt;
&lt;h2 id=&quot;advanced-build-example&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#advanced-build-example&quot; aria-label=&quot;Link to advanced-build-example&quot;&gt;&lt;/a&gt;Advanced Build Example&lt;/h2&gt;
&lt;p&gt;Methanol&amp;#039;s CLI supports various flags to override configurations on the fly:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;methanol build --pwa --search --theme blog --site-name &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;My Site&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This command enables PWA and search indexing, switches to the &lt;code&gt;blog&lt;/code&gt; theme, and sets a custom site name.&lt;/p&gt;
&lt;h2 id=&quot;project-structure&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#project-structure&quot; aria-label=&quot;Link to project-structure&quot;&gt;&lt;/a&gt;Project Structure&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;pages/&lt;/code&gt;: MDX/MD source files (alternatively &lt;code&gt;docs/&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;components/&lt;/code&gt;: Reusable JSX/TSX components.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;public/&lt;/code&gt;: Static assets (overrides theme-provided assets).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dist/&lt;/code&gt;: Optimized production output.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Files in &lt;code&gt;public/&lt;/code&gt; are served at the site root (e.g., &lt;code&gt;public/logo.png&lt;/code&gt; → &lt;code&gt;/logo.png&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id=&quot;creating-your-first-page&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#creating-your-first-page&quot; aria-label=&quot;Link to creating-your-first-page&quot;&gt;&lt;/a&gt;Creating Your First Page&lt;/h2&gt;
&lt;p&gt;Create &lt;code&gt;pages/index.mdx&lt;/code&gt; with the following content:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-mdx&quot;&gt;&lt;span class=&quot;pl-s&quot;&gt;---&lt;/span&gt;
&lt;span class=&quot;pl-ent&quot;&gt;title&lt;/span&gt;: &lt;span class=&quot;pl-s&quot;&gt;Home&lt;/span&gt;
&lt;span class=&quot;pl-s&quot;&gt;---&lt;/span&gt;

&lt;span class=&quot;pl-mh&quot;&gt;# &lt;span class=&quot;pl-en&quot;&gt;Welcome&lt;/span&gt;&lt;/span&gt;

This is my new documentation site.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The file structure is automatically mapped to URL routes:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code&gt;pages/index.mdx       -&amp;gt; /
pages/guide.mdx       -&amp;gt; /guide
pages/blog/post.mdx   -&amp;gt; /blog/post
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><author><name>Yukino Song</name></author><updated>2026-06-19T22:36:06.586Z</updated></entry><entry><title>Custom Components</title><link href="https://methanol.sudomaker.com/advanced/components"/><id>https://methanol.sudomaker.com/advanced/components</id><summary>Advanced component patterns including client-only components.</summary><content type="html">&lt;h1 id=&quot;custom-components&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#custom-components&quot; aria-label=&quot;Link to custom-components&quot;&gt;&lt;/a&gt;Custom Components&lt;/h1&gt;
&lt;p&gt;Methanol loads components from &lt;code&gt;components/&lt;/code&gt; and makes them available in every MDX file. Components are rendered with &lt;a href=&quot;https://github.com/SudoMaker/rEFui&quot;&gt;rEFui&lt;/a&gt;, so you can rely on its JSX runtime and APIs when building custom UI.&lt;/p&gt;
&lt;h2 id=&quot;component-discovery&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#component-discovery&quot; aria-label=&quot;Link to component-discovery&quot;&gt;&lt;/a&gt;Component Discovery&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Files can be &lt;code&gt;.jsx&lt;/code&gt;, &lt;code&gt;.tsx&lt;/code&gt;, &lt;code&gt;.js&lt;/code&gt;, or &lt;code&gt;.ts&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The file name becomes the component name.&lt;/li&gt;
&lt;li&gt;User components override theme components with the same name.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code&gt;components/
  Callout.jsx
  Hero.client.jsx
  Toc.static.jsx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;client-only-components&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#client-only-components&quot; aria-label=&quot;Link to client-only-components&quot;&gt;&lt;/a&gt;Client-Only Components&lt;/h2&gt;
&lt;p&gt;Use the &lt;code&gt;.client&lt;/code&gt; suffix to mark components that should only run on the client. This is useful for components that rely on browser APIs.&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code&gt;components/ThemeSearch.client.jsx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;static-components&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#static-components&quot; aria-label=&quot;Link to static-components&quot;&gt;&lt;/a&gt;Static Components&lt;/h2&gt;
&lt;p&gt;Use the &lt;code&gt;.static&lt;/code&gt; suffix for components that should be evaluated at build time.&lt;/p&gt;
&lt;p&gt;If a client-only component does not have a server/static counterpart, Methanol will try to statically render the client component. If the client component uses browser-only APIs, you must provide a corresponding static component for server rendering.&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code&gt;components/Notice.static.jsx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;importing-and-using&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#importing-and-using&quot; aria-label=&quot;Link to importing-and-using&quot;&gt;&lt;/a&gt;Importing and Using&lt;/h2&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;// components/Callout.jsx&lt;/span&gt;
&lt;span class=&quot;pl-k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pl-en&quot;&gt;Callout&lt;/span&gt;({ title }, &lt;span class=&quot;pl-k&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pl-v&quot;&gt;children&lt;/span&gt;) {
	&lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; (
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;div &lt;span class=&quot;pl-k&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;callout&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;strong&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;{title}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;strong&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;{&lt;span class=&quot;pl-k&quot;&gt;...&lt;/span&gt;children}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
	)
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;Callout title&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;Tip&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
  Keep paragraphs short &lt;span class=&quot;pl-k&quot;&gt;for&lt;/span&gt; scannable docs.
&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;Callout&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><author><name>Yukino Song</name></author><updated>2026-06-19T22:36:06.586Z</updated></entry><entry><title>Advanced</title><link href="https://methanol.sudomaker.com/advanced/"/><id>https://methanol.sudomaker.com/advanced/</id><summary>Advanced customization including theme development, runtime behavior, and component patterns.</summary><content type="html">&lt;h1 id=&quot;advanced&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#advanced&quot; aria-label=&quot;Link to advanced&quot;&gt;&lt;/a&gt;Advanced&lt;/h1&gt;
&lt;p&gt;This section is dedicated to theme developers, component authors, and users seeking deep control over the rendering logic and architectural patterns of their site.&lt;/p&gt;
&lt;h2 id=&quot;key-topics&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#key-topics&quot; aria-label=&quot;Link to key-topics&quot;&gt;&lt;/a&gt;Key Topics&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;./components&quot;&gt;Custom Components&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;./mdx-runtime&quot;&gt;MDX Runtime Helpers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;./themes/&quot;&gt;Theme Architecture&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;./theme-guide/&quot;&gt;Theme Implementation Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;./themes/default&quot;&gt;Default Theme Technical Details&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;./themes/meta&quot;&gt;Default Theme Meta Tag Specifications&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Yukino Song</name></author><updated>2026-06-19T22:36:06.586Z</updated></entry><entry><title>MDX Runtime Helpers</title><link href="https://methanol.sudomaker.com/advanced/mdx-runtime"/><id>https://methanol.sudomaker.com/advanced/mdx-runtime</id><summary>Runtime helpers, context injection, and hydration behavior.</summary><content type="html">&lt;h1 id=&quot;mdx-runtime-helpers&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#mdx-runtime-helpers&quot; aria-label=&quot;Link to mdx-runtime-helpers&quot;&gt;&lt;/a&gt;MDX Runtime Helpers&lt;/h1&gt;
&lt;p&gt;Methanol automatically injects a lightweight runtime context into every MDX file, facilitating the creation of dynamic content and simplified template integration.&lt;/p&gt;
&lt;h2 id=&quot;context-variables&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#context-variables&quot; aria-label=&quot;Link to context-variables&quot;&gt;&lt;/a&gt;Context Variables&lt;/h2&gt;
&lt;p&gt;The following helpers are globally available within MDX pages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ctx&lt;/code&gt;: The complete page and site context object.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontmatter&lt;/code&gt;: An alias for &lt;code&gt;ctx.page.frontmatter&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rawHTML&lt;/code&gt;: A utility for injecting unescaped HTML content.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-mdx&quot;&gt;&lt;span class=&quot;pl-mh&quot;&gt;# &lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-mh&quot;&gt;&lt;span class=&quot;pl-en&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pl-mh&quot;&gt;&lt;span class=&quot;pl-smi&quot;&gt;frontmatter&lt;/span&gt;&lt;span class=&quot;pl-en&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pl-c1&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;pl-en&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pl-k&quot;&gt;??&lt;/span&gt;&lt;span class=&quot;pl-en&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;&lt;span class=&quot;pl-en&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pl-smi&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;pl-en&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pl-c1&quot;&gt;title&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-mh&quot;&gt;&lt;span class=&quot;pl-en&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;

Current Route: &lt;span class=&quot;pl-s&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routePath&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;context-structure&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#context-structure&quot; aria-label=&quot;Link to context-structure&quot;&gt;&lt;/a&gt;Context Structure&lt;/h2&gt;
&lt;p&gt;Key properties available on the &lt;code&gt;ctx&lt;/code&gt; object:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ctx.page&lt;/code&gt;: Metadata for the current page (see detailed schema below).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ctx.pages&lt;/code&gt;: Flat list of pages for navigation (excludes &lt;code&gt;exclude: true&lt;/code&gt; and omits &lt;code&gt;/404&lt;/code&gt; + &lt;code&gt;/offline&lt;/code&gt; unless &lt;code&gt;hidden: false&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ctx.pagesByRoute&lt;/code&gt;: &lt;code&gt;Map&lt;/code&gt; of &lt;code&gt;routePath -&amp;gt; page&lt;/code&gt; for fast lookup.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ctx.pagesTree&lt;/code&gt;: The hierarchical navigation tree scoped to the current root.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ctx.site&lt;/code&gt;: Site-wide metadata (e.g., &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;root&lt;/code&gt;, &lt;code&gt;pagesDir&lt;/code&gt;, &lt;code&gt;distDir&lt;/code&gt;, &lt;code&gt;pagefind&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ctx.withBase(path)&lt;/code&gt;: A utility that prefixes URLs starting with &lt;code&gt;/&lt;/code&gt; with the configured &lt;code&gt;site.base&lt;/code&gt; or Vite base (relative URLs remain unchanged).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ctx.language&lt;/code&gt;: The currently active language entry (derived from directory index pages with &lt;code&gt;lang&lt;/code&gt;; includes &lt;code&gt;label&lt;/code&gt; and &lt;code&gt;code&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ctx.getSiblings()&lt;/code&gt;: Returns the &lt;code&gt;{ prev, next }&lt;/code&gt; page objects for the current page, respecting the active navigation root.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ctx.routePath&lt;/code&gt; / &lt;code&gt;ctx.routeHref&lt;/code&gt;: Route information for the current page.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ctx.path&lt;/code&gt;: Absolute filesystem path for the current page.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Note: You typically do not need to use &lt;code&gt;ctx.withBase()&lt;/code&gt; for &lt;code&gt;theme.sources&lt;/code&gt; or static files in &lt;code&gt;public/&lt;/code&gt;, as Methanol resolves these at build time. However, it is a useful safeguard for URLs generated dynamically via JavaScript in development environments.&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&quot;ctxsite&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#ctxsite&quot; aria-label=&quot;Link to ctxsite&quot;&gt;&lt;/a&gt;ctx.site&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;ctx.site&lt;/code&gt; is a snapshot of site-level metadata and build flags, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;name&lt;/code&gt;, &lt;code&gt;owner&lt;/code&gt;, &lt;code&gt;base&lt;/code&gt;, &lt;code&gt;mode&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;root&lt;/code&gt;, &lt;code&gt;pagesDir&lt;/code&gt;, &lt;code&gt;componentsDir&lt;/code&gt;, &lt;code&gt;publicDir&lt;/code&gt;, &lt;code&gt;distDir&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pagefind&lt;/code&gt; (&lt;code&gt;enabled&lt;/code&gt;, &lt;code&gt;options&lt;/code&gt;, &lt;code&gt;build&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;feed&lt;/code&gt; (&lt;code&gt;enabled&lt;/code&gt;, &lt;code&gt;atom&lt;/code&gt;, &lt;code&gt;path&lt;/code&gt;, &lt;code&gt;href&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pwa&lt;/code&gt; (&lt;code&gt;enabled&lt;/code&gt;, &lt;code&gt;manifestPath&lt;/code&gt;, &lt;code&gt;manifestHref&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;generatedAt&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;ctxpage-metadata-object&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#ctxpage-metadata-object&quot; aria-label=&quot;Link to ctxpage-metadata-object&quot;&gt;&lt;/a&gt;ctx.page Metadata Object&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;ctx.page&lt;/code&gt; provides comprehensive metadata for the current page. The full schema includes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;routePath&lt;/code&gt;: The normalized route path (e.g., &lt;code&gt;/guide/writing&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;routeHref&lt;/code&gt;: The base-aware href for linking (includes &lt;code&gt;site.base&lt;/code&gt; / Vite base).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;path&lt;/code&gt;: The absolute filesystem path to the source file.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;source&lt;/code&gt;: Origin of the file (&lt;code&gt;&amp;quot;user&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;theme&amp;quot;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;relativePath&lt;/code&gt;: The path relative to &lt;code&gt;pagesDir&lt;/code&gt; (including extension).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;name&lt;/code&gt;: The filename without extension.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dir&lt;/code&gt;: The directory path relative to &lt;code&gt;pagesDir&lt;/code&gt; (&lt;code&gt;&amp;#039;&amp;#039;&lt;/code&gt; for root).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;segments&lt;/code&gt;: An array of route segments.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;depth&lt;/code&gt;: The number of segments in the route.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;isIndex&lt;/code&gt;: Boolean, &lt;code&gt;true&lt;/code&gt; if the file is an &lt;code&gt;index.mdx&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;title&lt;/code&gt;: The resolved page title (from frontmatter or inferred from headings).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;frontmatter&lt;/code&gt;: The parsed YAML frontmatter object.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;matter&lt;/code&gt;: Raw frontmatter block metadata.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;content&lt;/code&gt;: Raw Markdown content excluding frontmatter.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;toc&lt;/code&gt;: Extracted Table of Contents entries.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;weight&lt;/code&gt;: Numeric sort order (from frontmatter).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;date&lt;/code&gt;: Normalized ISO date string (from frontmatter).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;isRoot&lt;/code&gt;: Boolean, &lt;code&gt;true&lt;/code&gt; if the page defines a navigation root.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hidden&lt;/code&gt;: Boolean, &lt;code&gt;true&lt;/code&gt; if the page is hidden from navigation.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hiddenByParent&lt;/code&gt;: String or &lt;code&gt;null&lt;/code&gt;, the nearest hidden ancestor route (e.g., &lt;code&gt;/hidden/&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hiddenByParents&lt;/code&gt;: Boolean, &lt;code&gt;true&lt;/code&gt; if the page is inside any hidden section.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;exclude&lt;/code&gt;: Boolean, &lt;code&gt;true&lt;/code&gt; if the page is excluded from the build.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;stats.size&lt;/code&gt;: File size in bytes.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;stats.createdAt&lt;/code&gt;: File creation timestamp (ISO) if available.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;stats.updatedAt&lt;/code&gt;: Last modified timestamp (ISO) if available.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Note: Directory index routes always include a trailing slash in &lt;code&gt;routePath&lt;/code&gt; (e.g., &lt;code&gt;/guide/&lt;/code&gt;).&lt;/em&gt;
&lt;em&gt;&lt;code&gt;ctx.page.getSiblings()&lt;/code&gt; is injected at runtime to facilitate previous/next navigation.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Usage Example:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-mdx&quot;&gt;&lt;span class=&quot;pl-s&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;page&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;title&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;pl-s&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;page&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;frontmatter&lt;/span&gt;?.&lt;span class=&quot;pl-smi&quot;&gt;excerpt&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id=&quot;ctxpages-list&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#ctxpages-list&quot; aria-label=&quot;Link to ctxpages-list&quot;&gt;&lt;/a&gt;ctx.pages List&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;ctx.pages&lt;/code&gt; is a flat array containing metadata objects (matching the &lt;code&gt;ctx.page&lt;/code&gt; schema) for navigation. It excludes pages marked with &lt;code&gt;exclude: true&lt;/code&gt;, and it omits &lt;code&gt;/404&lt;/code&gt; and &lt;code&gt;/offline&lt;/code&gt; unless those pages are explicitly set to &lt;code&gt;hidden: false&lt;/code&gt;. Hidden pages may still appear here, but &lt;code&gt;ctx.pagesTree&lt;/code&gt; will filter them out.&lt;/p&gt;
&lt;p&gt;This is ideal for generating custom indices, sitemaps, or manual navigation structures:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;ul&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
  {&lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;pages&lt;/span&gt;.&lt;span class=&quot;pl-en&quot;&gt;map&lt;/span&gt;((&lt;span class=&quot;pl-smi&quot;&gt;page&lt;/span&gt;) &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; (
    &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;a href&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;page&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;page&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routePath&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;page&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;title&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;li&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
  ))}
&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;ul&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id=&quot;ctxpagestree-hierarchy&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#ctxpagestree-hierarchy&quot; aria-label=&quot;Link to ctxpagestree-hierarchy&quot;&gt;&lt;/a&gt;ctx.pagesTree Hierarchy&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;ctx.pagesTree&lt;/code&gt; represents the navigation hierarchy for the current root context (adhering to &lt;code&gt;isRoot&lt;/code&gt; and &lt;code&gt;hidden&lt;/code&gt; rules). Node structure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;type&lt;/code&gt;: &lt;code&gt;&amp;quot;page&amp;quot;&lt;/code&gt; or &lt;code&gt;&amp;quot;directory&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;title&lt;/code&gt; / &lt;code&gt;name&lt;/code&gt;: Display label.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;routePath&lt;/code&gt; / &lt;code&gt;routeHref&lt;/code&gt;: Route for the node.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;children&lt;/code&gt;: Array of child nodes (for directories).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Use this to construct navigation UIs that mirror the sidebar structure:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;{&lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;pagesTree&lt;/span&gt;.&lt;span class=&quot;pl-en&quot;&gt;map&lt;/span&gt;((&lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;) &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; (
  &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;div&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;name&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
))}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id=&quot;ctxgetsiblings-helper&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#ctxgetsiblings-helper&quot; aria-label=&quot;Link to ctxgetsiblings-helper&quot;&gt;&lt;/a&gt;ctx.getSiblings Helper&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;ctx.getSiblings()&lt;/code&gt; retrieves the preceding and succeeding pages in the current navigation sequence. It respects the active navigation root and visibility rules, ensuring consistency with the sidebar order.&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;{(() &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; {
  &lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;siblings&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-en&quot;&gt;getSiblings&lt;/span&gt;()
  &lt;span class=&quot;pl-k&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;pl-k&quot;&gt;!&lt;/span&gt;siblings) &lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;null&lt;/span&gt;
  &lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; (
    &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;nav&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
      {&lt;span class=&quot;pl-smi&quot;&gt;siblings&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;prev&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;a href&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;siblings&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;prev&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;siblings&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;prev&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routePath&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;Previous&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; {&lt;span class=&quot;pl-smi&quot;&gt;siblings&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;prev&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;title&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;null&lt;/span&gt;}
      {&lt;span class=&quot;pl-smi&quot;&gt;siblings&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;next&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;a href&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;siblings&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;next&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;siblings&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;next&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routePath&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;Next&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; {&lt;span class=&quot;pl-smi&quot;&gt;siblings&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;next&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;title&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;null&lt;/span&gt;}
    &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;nav&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
  )
})()}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;rawhtml-utility&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#rawhtml-utility&quot; aria-label=&quot;Link to rawhtml-utility&quot;&gt;&lt;/a&gt;rawHTML Utility&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;rawHTML&lt;/code&gt; helper allows for the injection of unescaped HTML. This is particularly useful for inline scripts or specific markup that must remain unsanitized.&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;{&lt;span class=&quot;pl-en&quot;&gt;rawHTML&lt;/span&gt;(&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&amp;lt;span class=&amp;quot;badge&amp;quot;&amp;gt;Beta&amp;lt;/span&amp;gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;)}
{&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-en&quot;&gt;rawHTML&lt;/span&gt;&lt;span class=&quot;pl-pds&quot;&gt;`&lt;/span&gt;&amp;lt;&lt;span class=&quot;pl-ent&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;pl-e&quot;&gt;data-banner&lt;/span&gt;=&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;true&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&amp;gt;Banner&amp;lt;/&lt;span class=&quot;pl-ent&quot;&gt;div&lt;/span&gt;&amp;gt;&lt;span class=&quot;pl-pds&quot;&gt;`&lt;/span&gt;&lt;/span&gt;}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;code&gt;rawHTML&lt;/code&gt; supports reactivity via signals and standard template interpolation.&lt;/p&gt;</content><author><name>Yukino Song</name></author><updated>2026-06-19T22:36:06.586Z</updated></entry><entry><title>rEFui Runtime</title><link href="https://methanol.sudomaker.com/advanced/refui"/><id>https://methanol.sudomaker.com/advanced/refui</id><summary>Using rEFui in templates and the HTML renderer.</summary><content type="html">&lt;h1 id=&quot;refui-runtime&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#refui-runtime&quot; aria-label=&quot;Link to refui-runtime&quot;&gt;&lt;/a&gt;rEFui Runtime&lt;/h1&gt;
&lt;p&gt;Methanol uses &lt;a href=&quot;https://github.com/SudoMaker/rEFui&quot;&gt;rEFui&lt;/a&gt; as its JSX runtime. You do not need to learn rEFui to write docs, but it is useful for theme and component authors who want to build richer UI.&lt;/p&gt;
&lt;p&gt;Methanol uses rEFui on both sides:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Server/SSG:&lt;/strong&gt; render JSX to HTML during &lt;code&gt;build&lt;/code&gt; (and on the dev server).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client:&lt;/strong&gt; hydrate only client components as small “islands”, leaving the rest of the page as static HTML.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;when-it-matters&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#when-it-matters&quot; aria-label=&quot;Link to when-it-matters&quot;&gt;&lt;/a&gt;When It Matters&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Writing custom templates (&lt;code&gt;theme.template&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Building interactive components in &lt;code&gt;components/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;rawHTML&lt;/code&gt; and context helpers&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;jsx-runtime&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#jsx-runtime&quot; aria-label=&quot;Link to jsx-runtime&quot;&gt;&lt;/a&gt;JSX Runtime&lt;/h2&gt;
&lt;p&gt;Methanol compiles MDX with the automatic JSX runtime and &lt;code&gt;refui&lt;/code&gt; as the import source. You can still write standard JSX components.&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pl-en&quot;&gt;Callout&lt;/span&gt;(&lt;span class=&quot;pl-smi&quot;&gt;props&lt;/span&gt;, &lt;span class=&quot;pl-k&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pl-v&quot;&gt;children&lt;/span&gt;) {
	&lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;div &lt;span class=&quot;pl-k&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;callout&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;{&lt;span class=&quot;pl-k&quot;&gt;...&lt;/span&gt;children}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;div&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;component-demo-web&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#component-demo-web&quot; aria-label=&quot;Link to component-demo-web&quot;&gt;&lt;/a&gt;Component Demo (Web)&lt;/h2&gt;
&lt;p&gt;If you want to experiment with rEFui outside Methanol, use the DOM renderer with a small reactive component:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;import&lt;/span&gt; { &lt;span class=&quot;pl-smi&quot;&gt;signal&lt;/span&gt; } &lt;span class=&quot;pl-k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;refui&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-k&quot;&gt;import&lt;/span&gt; { &lt;span class=&quot;pl-smi&quot;&gt;createDOMRenderer&lt;/span&gt; } &lt;span class=&quot;pl-k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;refui/dom&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;pl-k&quot;&gt;import&lt;/span&gt; { &lt;span class=&quot;pl-smi&quot;&gt;defaults&lt;/span&gt; } &lt;span class=&quot;pl-k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;refui/browser&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;DOMRenderer&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-en&quot;&gt;createDOMRenderer&lt;/span&gt;(defaults)

&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;App&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; () &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; {
	&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;count&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-en&quot;&gt;signal&lt;/span&gt;(&lt;span class=&quot;pl-c1&quot;&gt;0&lt;/span&gt;)
	&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;increment&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; () &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; {
		&lt;span class=&quot;pl-smi&quot;&gt;count&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;1&lt;/span&gt;
	}

	&lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; (&lt;span class=&quot;pl-c1&quot;&gt;R&lt;/span&gt;) &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; (
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;h1&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;Hello, rEFui&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;h1&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;button on&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt;click&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{increment}&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;Click me&lt;span class=&quot;pl-k&quot;&gt;!&lt;/span&gt; Count is {count}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;button&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;p&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;Double&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; {&lt;span class=&quot;pl-en&quot;&gt;$&lt;/span&gt;(() &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;count&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;2&lt;/span&gt;)}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;p&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
	)
}

&lt;span class=&quot;pl-smi&quot;&gt;DOMRenderer&lt;/span&gt;.&lt;span class=&quot;pl-en&quot;&gt;render&lt;/span&gt;(&lt;span class=&quot;pl-c1&quot;&gt;document&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;body&lt;/span&gt;, App)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In Methanol, you typically export components and let the MDX renderer handle mounting.&lt;/p&gt;
&lt;h2 id=&quot;reference&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#reference&quot; aria-label=&quot;Link to reference&quot;&gt;&lt;/a&gt;Reference&lt;/h2&gt;
&lt;p&gt;See the &lt;a href=&quot;https://github.com/SudoMaker/rEFui&quot;&gt;rEFui repository&lt;/a&gt; for detailed runtime and renderer documentation.&lt;/p&gt;</content><author><name>Yukino Song</name></author><updated>2026-06-19T22:36:06.586Z</updated></entry><entry><title>Theme Guide</title><link href="https://methanol.sudomaker.com/advanced/theme-guide/"/><id>https://methanol.sudomaker.com/advanced/theme-guide/</id><summary>A step-by-step guide to building a custom theme, from directory structure to template implementation.</summary><content type="html">&lt;h1 id=&quot;theme-guide&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#theme-guide&quot; aria-label=&quot;Link to theme-guide&quot;&gt;&lt;/a&gt;Theme Guide&lt;/h1&gt;
&lt;p&gt;This guide provides a comprehensive walkthrough for building a custom Methanol theme. You will learn how to implement core features such as navigation, tables of contents, and multi-language support, while adhering to Methanol&amp;#039;s theme architecture.&lt;/p&gt;
&lt;h2 id=&quot;recommended-directory-structure&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#recommended-directory-structure&quot; aria-label=&quot;Link to recommended-directory-structure&quot;&gt;&lt;/a&gt;Recommended Directory Structure&lt;/h2&gt;
&lt;p&gt;A standard theme typically follows this structure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;index.js&lt;/code&gt;: Theme object entry point.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;page.jsx&lt;/code&gt;: Main layout template component.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;components/&lt;/code&gt;: Default MDX components (optional).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pages/&lt;/code&gt;: Theme-provided pages (optional).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;public/&lt;/code&gt;: Theme-specific static assets (optional).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sources/&lt;/code&gt;: Asset mappings via &lt;code&gt;theme.sources&lt;/code&gt; (optional).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;theme-configuration&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#theme-configuration&quot; aria-label=&quot;Link to theme-configuration&quot;&gt;&lt;/a&gt;Theme Configuration&lt;/h2&gt;
&lt;p&gt;To enable a custom theme, specify its root directory and template component in &lt;code&gt;methanol.config.js&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;PageTemplate&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;./theme/page.jsx&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;pl-k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;default&lt;/span&gt; () &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; ({
	theme&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; {
		root&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;./theme&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;,
		template&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; PageTemplate
	}
})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;theme-object-definition&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#theme-object-definition&quot; aria-label=&quot;Link to theme-object-definition&quot;&gt;&lt;/a&gt;Theme Object Definition&lt;/h2&gt;
&lt;p&gt;A theme can also be defined as an object in its entry point (&lt;code&gt;index.js&lt;/code&gt;). This is particularly useful for distributive themes:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;PageTemplate&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;./page.jsx&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;pl-k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;default&lt;/span&gt; () &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; ({
	theme&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; {
		root&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;.&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;,
		template&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; PageTemplate,
		componentsDir&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;./components&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;,
		pagesDir&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;./pages&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;,
		publicDir&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;./public&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;,
		sources&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; {
			&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;/theme&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;./sources&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;
		}
	}
})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;publishing-and-resolution&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#publishing-and-resolution&quot; aria-label=&quot;Link to publishing-and-resolution&quot;&gt;&lt;/a&gt;Publishing and Resolution&lt;/h2&gt;
&lt;p&gt;Themes can be published as npm packages named &lt;code&gt;methanol-theme-xxx&lt;/code&gt;. Methanol automatically resolves theme names using the following priority:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Built-in Themes:&lt;/strong&gt; Internal presets (e.g., &lt;code&gt;default&lt;/code&gt;, &lt;code&gt;blog&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Package Resolution:&lt;/strong&gt; Searches for &lt;code&gt;methanol-theme-xxx&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For local themes (files inside your project), import them in &lt;code&gt;methanol.config.*&lt;/code&gt; and set &lt;code&gt;theme&lt;/code&gt; to the imported theme object/factory.&lt;/p&gt;
&lt;h3 id=&quot;using-a-published-theme&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#using-a-published-theme&quot; aria-label=&quot;Link to using-a-published-theme&quot;&gt;&lt;/a&gt;Using a Published Theme&lt;/h3&gt;
&lt;p&gt;Via CLI:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;methanol build --theme xxx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Via &lt;code&gt;methanol.config.js&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;default&lt;/span&gt; () &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; ({
	theme&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;xxx&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;
})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;template-specification&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#template-specification&quot; aria-label=&quot;Link to template-specification&quot;&gt;&lt;/a&gt;Template Specification&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;theme.template&lt;/code&gt; function receives a context object with the following properties:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ctx&lt;/code&gt;: Site and page context.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;page&lt;/code&gt;: Alias for &lt;code&gt;ctx.page&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PageContent&lt;/code&gt;: Renders the current page body.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ExtraHead&lt;/code&gt;: Injects runtime scripts, styles, and per-page &lt;code&gt;&amp;lt;Head&amp;gt;&lt;/code&gt; content.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;withBase&lt;/code&gt;: Base-path aware URL helper.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;components&lt;/code&gt;: Merged set of theme and user components.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;HTMLRenderer&lt;/code&gt;: rEFui rendering utilities.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;minimal-implementation&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#minimal-implementation&quot; aria-label=&quot;Link to minimal-implementation&quot;&gt;&lt;/a&gt;Minimal Implementation&lt;/h3&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;import&lt;/span&gt; { &lt;span class=&quot;pl-smi&quot;&gt;HTMLRenderer&lt;/span&gt; } &lt;span class=&quot;pl-k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;methanol&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;

&lt;span class=&quot;pl-k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;default&lt;/span&gt; ({ PageContent, ExtraHead, ctx }) &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; (
	&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&amp;gt;&lt;/span&gt;
		{&lt;span class=&quot;pl-smi&quot;&gt;HTMLRenderer&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;rawHTML&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;`&lt;/span&gt;&amp;lt;!doctype html&amp;gt;&lt;span class=&quot;pl-pds&quot;&gt;`&lt;/span&gt;&lt;/span&gt;}
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;html lang&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;en&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;head&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;meta charset&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;UTF-8&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;meta name&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;viewport&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; content&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;width=device-width&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;ExtraHead &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;title&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;page&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;site&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;name&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;title&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;head&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;body&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;PageContent &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;body&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;html&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;For production-ready themes, refer to the following specialized guides:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;./navigation&quot;&gt;Navigation Rendering&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;./toc&quot;&gt;Table of Contents (ToC)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;./prev-next&quot;&gt;Adjacent Page Links&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;./language-switch&quot;&gt;Language Switching&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;./special-pages&quot;&gt;Special-Purpose Pages&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Yukino Song</name></author><updated>2026-06-19T22:36:06.586Z</updated></entry><entry><title>Language Switcher</title><link href="https://methanol.sudomaker.com/advanced/theme-guide/language-switch"/><id>https://methanol.sudomaker.com/advanced/theme-guide/language-switch</id><summary>Implementing a language switching UI utilizing and .</summary><content type="html">&lt;h1 id=&quot;language-switcher&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#language-switcher&quot; aria-label=&quot;Link to language-switcher&quot;&gt;&lt;/a&gt;Language Switcher&lt;/h1&gt;
&lt;p&gt;In Methanol, multi-language support is file-system based. Any directory containing an &lt;code&gt;index.mdx&lt;/code&gt; with a &lt;code&gt;lang&lt;/code&gt; property in its frontmatter is identified as a language entry point.&lt;/p&gt;
&lt;p&gt;Your theme template receives the following language-related properties:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ctx.languages&lt;/code&gt;: A list of all identified language entry points.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ctx.language&lt;/code&gt;: The language entry point corresponding to the current page (or &lt;code&gt;null&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each entry includes &lt;code&gt;routePath&lt;/code&gt;, &lt;code&gt;routeHref&lt;/code&gt;, &lt;code&gt;label&lt;/code&gt;, and &lt;code&gt;code&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;dropdown-switcher-implementation&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#dropdown-switcher-implementation&quot; aria-label=&quot;Link to dropdown-switcher-implementation&quot;&gt;&lt;/a&gt;Dropdown Switcher Implementation&lt;/h2&gt;
&lt;p&gt;A standard implementation using a &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;LanguageSwitch&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; ({ ctx }) &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; {
	&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;languages&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;languages&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;||&lt;/span&gt; []
	&lt;span class=&quot;pl-k&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;pl-smi&quot;&gt;languages&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;0&lt;/span&gt;) &lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;null&lt;/span&gt;

	&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;currentHref&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt;
	&lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; (
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;select
			aria&lt;span class=&quot;pl-k&quot;&gt;-&lt;/span&gt;label&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;Select language&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
			onchange&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;location.href=this.value&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
			value&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{currentHref &lt;span class=&quot;pl-k&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;undefined&lt;/span&gt;}
		&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			{&lt;span class=&quot;pl-smi&quot;&gt;languages&lt;/span&gt;.&lt;span class=&quot;pl-en&quot;&gt;map&lt;/span&gt;((&lt;span class=&quot;pl-smi&quot;&gt;lang&lt;/span&gt;) &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; (
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;option value&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;lang&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt;} selected&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;lang&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;===&lt;/span&gt; currentHref &lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;null&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
					{&lt;span class=&quot;pl-smi&quot;&gt;lang&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;label&lt;/span&gt;}
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;option&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			))}
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;select&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
	)
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;link-list-variant&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#link-list-variant&quot; aria-label=&quot;Link to link-list-variant&quot;&gt;&lt;/a&gt;Link List Variant&lt;/h2&gt;
&lt;p&gt;A list-based implementation suitable for footers or headers:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;LanguageLinks&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; ({ ctx }) &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; {
	&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;languages&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;languages&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;||&lt;/span&gt; []
	&lt;span class=&quot;pl-k&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;pl-smi&quot;&gt;languages&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;0&lt;/span&gt;) &lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;null&lt;/span&gt;

	&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;currentHref&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt;
	&lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; (
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;nav aria&lt;span class=&quot;pl-k&quot;&gt;-&lt;/span&gt;label&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;Language selection&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			{&lt;span class=&quot;pl-smi&quot;&gt;languages&lt;/span&gt;.&lt;span class=&quot;pl-en&quot;&gt;map&lt;/span&gt;((&lt;span class=&quot;pl-smi&quot;&gt;lang&lt;/span&gt;) &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; (
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;a href&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;lang&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt;} aria&lt;span class=&quot;pl-k&quot;&gt;-&lt;/span&gt;current&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;lang&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;===&lt;/span&gt; currentHref &lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;page&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;null&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
					{&lt;span class=&quot;pl-smi&quot;&gt;lang&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;label&lt;/span&gt;}
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			))}
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;nav&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
	)
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;implementation-notes&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#implementation-notes&quot; aria-label=&quot;Link to implementation-notes&quot;&gt;&lt;/a&gt;Implementation Notes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;URL Handling:&lt;/strong&gt; Always use &lt;code&gt;routeHref&lt;/code&gt; for links to ensure they are base-path aware.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Root Scoping:&lt;/strong&gt; It is common to set &lt;code&gt;isRoot: true&lt;/code&gt; at each language&amp;#039;s entry point to maintain independent navigation trees for each language.&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Yukino Song</name></author><updated>2026-06-19T22:36:06.586Z</updated></entry><entry><title>Rendering Navigation</title><link href="https://methanol.sudomaker.com/advanced/theme-guide/navigation"/><id>https://methanol.sudomaker.com/advanced/theme-guide/navigation</id><summary>Building a sidebar or menu navigation utilizing .</summary><content type="html">&lt;h1 id=&quot;rendering-navigation&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#rendering-navigation&quot; aria-label=&quot;Link to rendering-navigation&quot;&gt;&lt;/a&gt;Rendering Navigation&lt;/h1&gt;
&lt;p&gt;Methanol provides a hierarchical navigation tree via &lt;code&gt;ctx.pagesTree&lt;/code&gt;. This tree is automatically scoped to the current navigation root (&lt;code&gt;isRoot&lt;/code&gt;) and respects all &lt;code&gt;hidden&lt;/code&gt; and &lt;code&gt;exclude&lt;/code&gt; rules.&lt;/p&gt;
&lt;p&gt;Each node in the tree uses the following structure:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;{
	type&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;page&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;directory&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;,
	title&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;...&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;,
	name&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;...&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;,
	routePath&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;/guide/&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;,
	routeHref&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;/docs/guide/&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;pl-c&quot;&gt;// Base-aware URL&lt;/span&gt;
	children&lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; []
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;sidebar-implementation&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#sidebar-implementation&quot; aria-label=&quot;Link to sidebar-implementation&quot;&gt;&lt;/a&gt;Sidebar Implementation&lt;/h2&gt;
&lt;p&gt;The following example demonstrates a recursive sidebar component:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;NavTree&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; ({ nodes, currentHref }) &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; (
	&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;ul&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
		{(nodes &lt;span class=&quot;pl-k&quot;&gt;||&lt;/span&gt; []).&lt;span class=&quot;pl-en&quot;&gt;map&lt;/span&gt;((&lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;) &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; {
			&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;label&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routePath&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;directory&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt;) {
				&lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; (
					&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
						{&lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;a href&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;{label}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;span&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;{label}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;span&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;}
						{&lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;NavTree nodes&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;children&lt;/span&gt;} currentHref&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{currentHref} &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;null&lt;/span&gt;}
					&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
				)
			}
			&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;isActive&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;===&lt;/span&gt; currentHref
			&lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; (
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;li&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
					&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;a href&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;node&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt;} aria&lt;span class=&quot;pl-k&quot;&gt;-&lt;/span&gt;current&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{isActive &lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;page&lt;span class=&quot;pl-pds&quot;&gt;&amp;#039;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;null&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
						{label}
					&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;li&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			)
		})}
	&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;ul&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
)

&lt;span class=&quot;pl-k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pl-en&quot;&gt;PageTemplate&lt;/span&gt;({ PageContent, ExtraHead, ctx }) {
	&lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; (
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;html&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;head&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
					&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;ExtraHead &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;head&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;body&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
					&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;aside&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
						&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;NavTree nodes&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;pagesTree&lt;/span&gt;} currentHref&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;page&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt;} &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt;
					&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;aside&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
					&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;main&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
						&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;PageContent &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt;
					&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;main&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;body&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;html&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
	)
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;best-practices&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#best-practices&quot; aria-label=&quot;Link to best-practices&quot;&gt;&lt;/a&gt;Best Practices&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Use &lt;code&gt;routeHref&lt;/code&gt;:&lt;/strong&gt; Always use &lt;code&gt;routeHref&lt;/code&gt; for navigation links to ensure the &lt;code&gt;site.base&lt;/code&gt; prefix is correctly applied.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Trailing Slashes:&lt;/strong&gt; Directory index routes always include a trailing slash in their &lt;code&gt;routePath&lt;/code&gt; (e.g., &lt;code&gt;/guide/&lt;/code&gt;). This is important for path matching and relative link resolution.&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Yukino Song</name></author><updated>2026-06-19T22:36:06.586Z</updated></entry><entry><title>Adjacent Page Links</title><link href="https://methanol.sudomaker.com/advanced/theme-guide/prev-next"/><id>https://methanol.sudomaker.com/advanced/theme-guide/prev-next</id><summary>Implementing previous and next page navigation utilizing .</summary><content type="html">&lt;h1 id=&quot;adjacent-page-links&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#adjacent-page-links&quot; aria-label=&quot;Link to adjacent-page-links&quot;&gt;&lt;/a&gt;Adjacent Page Links&lt;/h1&gt;
&lt;p&gt;Methanol provides a helper to implement &amp;quot;Previous&amp;quot; and &amp;quot;Next&amp;quot; navigation, ensuring users can traverse your documentation in the intended order:&lt;/p&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; { &lt;span class=&quot;pl-c1&quot;&gt;prev&lt;/span&gt;, &lt;span class=&quot;pl-c1&quot;&gt;next&lt;/span&gt; } &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-en&quot;&gt;getSiblings&lt;/span&gt;() &lt;span class=&quot;pl-k&quot;&gt;||&lt;/span&gt; {}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The returned sequence is automatically scoped to the current navigation root and respects the sidebar&amp;#039;s display order.&lt;/p&gt;
&lt;h2 id=&quot;implementation-example&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#implementation-example&quot; aria-label=&quot;Link to implementation-example&quot;&gt;&lt;/a&gt;Implementation Example&lt;/h2&gt;
&lt;div class=&quot;code-block-container&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;PrevNext&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; ({ ctx }) &lt;span class=&quot;pl-k&quot;&gt;=&amp;gt;&lt;/span&gt; {
	&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;siblings&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;pl-smi&quot;&gt;ctx&lt;/span&gt;.&lt;span class=&quot;pl-en&quot;&gt;getSiblings&lt;/span&gt;()
	&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;prev&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; siblings&lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;prev&lt;/span&gt;
	&lt;span class=&quot;pl-k&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;next&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt; siblings&lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;next&lt;/span&gt;
	&lt;span class=&quot;pl-k&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;pl-k&quot;&gt;!&lt;/span&gt;prev &lt;span class=&quot;pl-k&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;!&lt;/span&gt;next) &lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;null&lt;/span&gt;

	&lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; (
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;nav aria&lt;span class=&quot;pl-k&quot;&gt;-&lt;/span&gt;label&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pl-s&quot;&gt;&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;Pagination&lt;span class=&quot;pl-pds&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			{prev &lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;a href&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;prev&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;← {&lt;span class=&quot;pl-smi&quot;&gt;prev&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;title&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;span &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt;}
			{next &lt;span class=&quot;pl-k&quot;&gt;?&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;a href&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;next&lt;/span&gt;.&lt;span class=&quot;pl-smi&quot;&gt;routeHref&lt;/span&gt;}&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;{&lt;span class=&quot;pl-smi&quot;&gt;next&lt;/span&gt;.&lt;span class=&quot;pl-c1&quot;&gt;title&lt;/span&gt;} →&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;a&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;span &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt;}
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;nav&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
	)
}

&lt;span class=&quot;pl-k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;pl-k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;pl-en&quot;&gt;PageTemplate&lt;/span&gt;({ PageContent, ExtraHead, ctx }) {
	&lt;span class=&quot;pl-k&quot;&gt;return&lt;/span&gt; (
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;html&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;head&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
					&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;ExtraHead &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;head&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;body&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
					&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;main&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
						&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;PageContent &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt;
						&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;&lt;/span&gt;PrevNext ctx&lt;span class=&quot;pl-k&quot;&gt;=&lt;/span&gt;{ctx} &lt;span class=&quot;pl-k&quot;&gt;/&amp;gt;&lt;/span&gt;
					&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;main&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
				&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;body&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
			&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&lt;/span&gt;html&lt;span class=&quot;pl-k&quot;&gt;&amp;gt;&lt;/span&gt;
		&lt;span class=&quot;pl-k&quot;&gt;&amp;lt;/&amp;gt;&lt;/span&gt;
	)
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&quot;best-practices&quot;&gt;&lt;a class=&quot;heading-anchor&quot; href=&quot;#best-practices&quot; aria-label=&quot;Link to best-practices&quot;&gt;&lt;/a&gt;Best Practices&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Base Path Awareness:&lt;/strong&gt; Use &lt;code&gt;routeHref&lt;/code&gt; for all pagination links to ensure they work correctly with &lt;code&gt;site.base&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Filtering:&lt;/strong&gt; Pages marked as &lt;code&gt;hidden: true&lt;/code&gt; are automatically excluded from the sibling sequence, maintaining a clean navigation flow.&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Yukino Song</name></author><updated>2026-06-19T22:36:06.586Z</updated></entry></feed>