Loading Page Content...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
While Markdown excels at formatting readable document text, modern web publishing platforms (like Next.js, Astro, Jekyll, Hugo, and Docusaurus) also require structured data—such as post titles, publication dates, SEO meta descriptions, authors, and tag categories.
Frontmatter is a standardized block of metadata placed at the very top of a Markdown file, cleanly separated from the body text.
The most popular format is YAML Frontmatter, enclosed between two lines of triple hyphens (---):
When a static site generator (or a library like gray-matter) processes a Markdown file:
--- fences.data) is used to populate page <title>, OpenGraph preview cards, and blog listing filters, while the body text (content) is rendered as HTML!While YAML is used by 95% of developers, other formats are supported:
| Format | Opening / Closing Delimiter | Syntax Example |
|---|---|---|
| YAML | --- | title: "My Post" |
| TOML | +++ | title = "My Post" (Common in Hugo) |
| JSON | ;;; or --- | { "title": "My Post" } |
Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
| Previous Lesson | Next Lesson |
|---|---|
| Issue & Pull Request Templates in GitHub | Markdown in Modern SSGs & MDX (Astro, Next.js) |
Test your understanding of this lesson with 5 questions. Each question has one correct answer.