Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Permalinks and URLs

Configuration options for controlling site navigation and URL structure.

URL Structure

By default, MyST flattens the directory structure when generating URLs. For example:

A file at

a/b/page.md

renders at URL

/page

Folder structure URLs

To make URLs respect nested folder structure:

site:
  options:
    folders: true

For example, a file at

a/b/page.md

renders at URL

/a/b/page

External and Internal URLs

The following config makes any external URL behave as if it were an internal URL if it matches the pattern:

site:
  options:
    internal_domains: "mystmd.org"

For example:

You can match an exact domain (e.g. mystmd.org) or use a wildcard to match a single subdomain level. Matches will only be for that subdomain level, not deeper ones, and will not match the root domain (e.g. *.mystmd.org matches docs.mystmd.org but not a.b.mystmd.org or mystmd.org).