Skip to content

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:

  1. default - The standard documentation page layout with sidebar, content, and table of contents.

  2. doc - An alias for the default template, functionally identical to default.

  3. 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.

  4. central - A centered content layout without sidebar navigation or table of contents, good for focused content like error pages or standalone articles.

  5. 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 Page
template: 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 Metadata
title: Your Page Title
description: A brief description of the page for SEO and social sharing
slug: custom-url-path # Override the default URL path
# Layout and Presentation
template: "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 URL
editUrl: false # Disable the edit link
lastUpdated: true # Show last updated timestamp
lastUpdated: false # Hide last updated timestamp
lastUpdated: "2023-01-01" # Custom last updated date
tableOfContents:
minHeadingLevel: 2 # Minimum heading level to include in TOC
maxHeadingLevel: 3 # Maximum heading level to include in TOC
enabled: true # Enable/disable TOC
hero:
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 Organization
sidebar:
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, note
head:
- 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 Behavior
pagefind: true # Include/exclude page from search
pagefind: false
banner:
content: "This page is under construction"
variant: "caution" # default, success, danger, caution, tip, note
# Content Display
video:
src: "https://youtube.com/embed/abc123"
title: "Video Title"
description: "Brief video description"
# Custom Frontmatter
custom:
property: "value" # Add any custom properties you need
# Internationalization
i18n:
title: "Localized Title"
description: "Localized Description"
# Completely hide the page from navigation and autogenerated links
excludeFromIndexes: true
---
  1. hero: Creates a prominent hero section at the top of the page, ideal for landing pages.

  2. sidebar: Controls how the page appears in the navigation sidebar.

  3. head: Allows adding custom elements to the page’s <head> section, useful for page-specific scripts, styles, or meta tags.

  4. banner: Displays a notification banner at the top of the page.

  5. tableOfContents: Configures or disables the table of contents shown on the right side.

  6. 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.