Frontmatter and Metadata
YAML frontmatter is a small metadata block at the top of a Markdown file. Use it to give an exported document a clear title, describe a shared document, or choose its reading direction and slide theme.
Adding metadata does not publish a vault document or make it discoverable by search engines. You choose when to export or share it. Document Metadata is available for editable Markdown documents; code and plain-text files use File Properties.
Table of Contents
Start with Three Fields
A frontmatter block lives between two --- lines at the very top of the file. This sample review of Anini Counter, a countdown app configured through its URL, uses a title, a description, and an author.
Markdown Source
---
title: "Anini Counter Documentation Review"
description: "Review fixed-date and duration examples and check the English and Arabic instructions."
author: "Mohammad Anini"
---
# Anini Counter Documentation Review
Make it easier to set up a countdown to a specific date or for a fixed duration.
MDash hides the frontmatter block from the rendered body. Each title has a different job.
- The
#heading is what readers see in the document body. titlenames the exported HTML and supplies the default shared-link title.seoTitle, when set, overrides the title shown in a shared-link preview.
Edit Metadata in MDash
- Open an editable Markdown document.
- Choose Edit Metadata in the toolbar, or run Edit Document Metadata from the command palette.
- Enter a title, description, and author. Separate Tags and Keywords with commas.
- Choose Document Direction and Slide Theme if the defaults do not suit the document.
- Choose Save Metadata. Check the frontmatter at the top of the editor. If you added tags or changed direction, check those changes in Preview.
The form writes these fields into the file itself. See Themes and Direction and Presentation Mode for practical guidance on direction and slides.
Recognized Fields
| Field | Purpose | Used By |
|---|---|---|
title | Human-readable document title | HTML export, public guides, and shared-link metadata |
description | Short summary of the document | HTML export, public guides, and shared-link metadata |
author | Document author | HTML export, public guide byline, and shared-link description |
tags | Inline YAML array for visible classification | Preview chips and HTML keywords metadata |
keywords | Inline YAML array for additional search terms | HTML keywords metadata |
dir | Document direction: auto, ltr, or rtl | Editor, Preview, presentations, and exports |
theme | Slide theme: default, light, dark, or vintage | Presentation Mode and presentation PDF export |
published | Publication date of a bundled public guide | Public guide structured metadata |
updated | Date when a bundled public guide was last changed | Last Updated byline and public guide structured metadata |
seoTitle | Preferred title for public or shared-link metadata | Public bundled guides and shared Markdown documents |
Regular vault documents preserve date fields you write in the source. They do not change the file's local Created or Modified timestamps. seoTitle can personalize shared-link metadata while title remains the HTML export title. The metadata form does not edit seoTitle, published, or updated; add them in the source when needed.
To add tags, automatic reading direction, and a dark slide theme, place these fields inside the existing frontmatter block.
tags: ["documentation", "review"]
dir: auto
theme: dark
In Preview, these tags appear as chips above the document. To show a tag as a chip, use letters A–Z or a–z, digits, or underscores. Hyphens can also appear after the first character. Tags with spaces or other characters can still appear in HTML keywords metadata.
Simple Values and Structured YAML
- Scalar (
title: "value"): single line, optionally quoted. - List (
tags: ["a", "b"]): inline YAML array. The metadata modal writes this form.
MDash reads its supported fields as top-level single-line scalars or inline arrays. Shared-link previews also read folded (>) and literal (|) blocks for titles, descriptions, and authors, joining their lines with spaces. Use quoted strings when a single-line value contains punctuation such as a colon.
For nested mappings, block-style lists, or multiline strings, edit the frontmatter directly in the source. A custom nested field such as project.owner does not become MDash's top-level author field. Keep the fields MDash uses in the simple forms above, and use custom keys for structured data needed by other tools.
The metadata form preserves unrelated fields and leaves an unsupported field representation unchanged when you edit another field. An unsupported value may appear empty in the form. Entering a replacement writes the field in MDash's simple format, replacing its previous value. Use the source editor when you want to keep or change complex YAML deliberately.
Shared-Link Previews
When you share a Markdown document by URL, the preview title uses seoTitle, then title, then the filename with common extensions removed. A heading in the body does not set this title. Without a usable title or filename, the preview says Shared Document · MDash.
A supplied description provides the preview summary. Otherwise, MDash uses “View a shared Markdown document in MDash.” An author adds a By Author prefix to the shared description without changing the stored field. Use a short, specific summary of the document.
Plain-text and code documents also use the filename, with common extensions removed. Their default description identifies the detected format, such as “View a shared TypeScript file in MDash.” Plain text uses “View a shared text file in MDash.” Unknown formats use “View a shared file in MDash.”
Shared documents use the main MDash social image. The browser uses the same title rules, including offline. Social platforms may cache an older preview after you send them a link.
How Social Previews Are Prepared
The MDash metadata service reads the shared URL transiently to personalize the initial HTML for social crawlers. It does not store the document or insert its body into that response. If the service is unavailable, the initial social preview uses the generic default and the reader still works. See Privacy and Local Storage for what sharing sends outside your browser.
Exports
When you export to HTML, MDash:
- Uses
titleas the page title. - Emits
<meta name="description">if set. - Emits
<meta name="author">if set. - Merges
tagsandkeywordsinto<meta name="keywords">.
This gives exported HTML useful basic metadata. PDF export uses the browser print engine, so document properties can vary by browser and operating system. Import, Export, and Backup explains each output format.
Troubleshooting
- Keep the opening frontmatter delimiter on the first line.
- Use inline arrays for
tagsandkeywords. - If a field is not recognized, MDash preserves it but does not assign application behavior to it.