Available Front-Matter Options
In Starlight, there are several available template options you can specify in the frontmatter’s template
field. Here are all the available template options:
-
default
- The standard documentation page layout with sidebar, content, and table of contents. -
doc
- An alias for the default template, functionally identical todefault
. -
splash
- A wider layout designed for landing pages without the table of contents. This gives more horizontal space and is ideal for marketing or introduction pages. -
central
- A centered content layout without sidebar navigation or table of contents, good for focused content like error pages or standalone articles. -
blank
- A minimal template with almost no built-in styling or layout constraints, allowing you to build completely custom page layouts from scratch.
You can specify these in your frontmatter like this:
---title: My Pagetemplate: splash # Or any of the other options---
If you don’t specify a template, pages will use the default
template by default.
Available Frontmatter Options for Starlight Markdown/MDX Files
Section titled “Available Frontmatter Options for Starlight Markdown/MDX Files”Here are all the available options you can use in the frontmatter section (between the ---
markers) of your .md
and .mdx
files in a Starlight project:
---# Basic Page Metadatatitle: Your Page Titledescription: A brief description of the page for SEO and social sharingslug: custom-url-path # Override the default URL path
# Layout and Presentationtemplate: "splash" # Use a specific page template (default, splash, doc, etc.)editUrl: "https://github.com/your-repo/edit/main/src/content/docs/page.md" # Custom edit URLeditUrl: false # Disable the edit linklastUpdated: true # Show last updated timestamplastUpdated: false # Hide last updated timestamplastUpdated: "2023-01-01" # Custom last updated datetableOfContents: minHeadingLevel: 2 # Minimum heading level to include in TOC maxHeadingLevel: 3 # Maximum heading level to include in TOC enabled: true # Enable/disable TOChero: title: "Custom Hero Title" # Override the page title in the hero section tagline: "Your catchy tagline here" # Tagline displayed below the title image: file: "../../assets/hero-image.png" # Hero image path alt: "Description of the hero image" # Alt text for the image actions: - text: "Get Started" link: "/getting-started/" variant: "primary" # primary, secondary, minimal, outline - text: "View on GitHub" link: "https://github.com/your-repo/" variant: "secondary" icon: "github" # Icon from the Starlight icon set
# Navigation and Organizationsidebar: label: "Custom Sidebar Label" # Custom label in the sidebar order: 3 # Order in the sidebar hidden: false # Control sidebar visibility badge: text: "New" variant: "default" # default, success, danger, caution, tip, notehead: - tag: "meta" attrs: property: "og:image" content: "https://example.com/custom-social-image.jpg" - tag: "link" attrs: rel: "stylesheet" href: "/custom-styles.css" - tag: "script" attrs: src: "/custom-script.js" type: "module"
# Page Classification and Behaviorpagefind: true # Include/exclude page from searchpagefind: falsebanner: content: "This page is under construction" variant: "caution" # default, success, danger, caution, tip, note
# Content Displayvideo: src: "https://youtube.com/embed/abc123" title: "Video Title" description: "Brief video description"
# Custom Frontmattercustom: property: "value" # Add any custom properties you need
# Internationalizationi18n: title: "Localized Title" description: "Localized Description"
# Completely hide the page from navigation and autogenerated linksexcludeFromIndexes: true---
Notes About Some Key Options:
Section titled “Notes About Some Key Options:”-
hero
: Creates a prominent hero section at the top of the page, ideal for landing pages. -
sidebar
: Controls how the page appears in the navigation sidebar. -
head
: Allows adding custom elements to the page’s<head>
section, useful for page-specific scripts, styles, or meta tags. -
banner
: Displays a notification banner at the top of the page. -
tableOfContents
: Configures or disables the table of contents shown on the right side. -
Custom properties: You can add any custom properties with
custom:
that your theme or components might use.
All these options are optional - you only need to include the ones relevant to your specific page. The only commonly required field is title
.