Page-specific Scripts and Styles

Methanol can automatically include a script or stylesheet that sits next to a page file, using the same base name.

How It Works

If you have:

pages/
  guide/
    components.mdx
    components.css
    components.js

then components.css and components.js are injected into the page head when /guide/components renders.

Supported Extensions

Styles:

Scripts:

Example

pages/
  about.mdx
  about.css
  about.ts

about.css and about.ts will be loaded only on /about.

Notes