NanoFile
Menu

Markdown front matter

Front matter is metadata at the very top of a markdown file, fenced by three dashes above and below. Static site generators, Obsidian and most note tools read it; a plain renderer ignores it or, worse, prints it.

Front matter

title: Opening .md files date: 2026-08-27 tags: - markdown - tools draft: false

The document starts here

This viewer lifts front matter out of the document and shows it as a metadata card, which is why a file with front matter does not open here with a stray horizontal rule and an enormous heading.

What usually goes wrong

  • It must be the very first thing in the file. One blank line above it and it stops being front matter and becomes a horizontal rule followed by a heading.
  • YAML is whitespace-sensitive and cares about tabs. Use spaces.
  • A value containing a colon needs quotes: title: "Markdown: a history".
  • Different tools expect different keys. Hugo, Jekyll, Astro and Obsidian all read front matter, and none of them agree on what goes in it.

Where it behaves differently

It renders as written on Obsidian. Everywhere else in this table it does something else, and that is worth reading before you paste.

PlatformBehaviour
GitHubIts documentation does not say, so neither do we.
GitLabYAML, TOML or JSON, and GitLab hides it rather than rendering it.
VS Code previewIts documentation does not say, so neither do we.
NotionNot supported. The syntax arrives as its own punctuation.
DiscordNot supported. The syntax arrives as its own punctuation.
SlackNot supported. The syntax arrives as its own punctuation.

Related

For the .md file that arrives in Mail

A markdown file on a phone is the worst case: no editor, no preview, and a share sheet full of apps that want to import it into a library. The iPhone and iPad app opens it where it landed, renders it, and lets you edit and save it back.

For iPhone and iPad.