Frontmatter

Overview

Frontmatter is the TOML block at the top of an .mq page. It lets you override site-wide defaults for things like theme, layout, content width, and page metadata.

There are two places where you can define configuration settings in a Marque project:

marque.toml at the project's root for site-wide defaults.

Frontmatter at the top of each .mq page for per-page overrides.

Defaults Configuration (marque.toml)

The marque.toml file is where you define your configuration settings that apply to the entire site. This is where you define key parameters such as:

toml
title = "Marque"
description = "Built with Marque"
layout = "sidebar"
theme = "rustique"
width = 82

These settings apply to the entire site.

Here's what each parameter does:

  • title: The default title of your site, used as main icon in the navbar and in page titles.
  • description: A default meta description for your site, used in the <head> of your pages.
  • layout: The default navigation layout for your pages (topnav/sidebar).
  • theme: The default theme for your pages (for example rustique or javarti).
  • width: The default content width for your pages, which can be a percentage (82, 50%) or predefined values like narrow (70%), normal (82%), wide (92%), or full (100%).

Per-page Overrides (Inline Frontmatter)

Pages can override site-wide defaults by including frontmatter at the top of the .mq file:

mq
+++               <--- opening TOML frontmatter fence
title = "Layouts"     <--- override page title
layout = "topnav"     <--- override page layout
theme = "mida"        <--- override page theme
width = "50%"         <--- override page width
nav = "new-link"      <--- override output slug
+++               <--- closing fence
# Layout          <--- page content starts here
@divider
  rest of content...

These settings override default settings and apply only to the page they are defined in.

Every parameter defined in a page's frontmatter is optional. A page can work without any frontmatter, in which case it will simply inherit all settings from marque.toml. Missing or invalid parameters in the frontmatter will fall back to the defaults defined in marque.toml.

nav overrides the page slug used for the output filename and route. Navigation labels come from summary.mq.

Try it out!

Try overriding this page's content width:

Common mistakes

summary.mq controls navigation order and labels.
Frontmatter does not define nav ordering.