Aller au contenu
Le blog de Pascal Andy - L'homme et les relations technologiques

Frontmatter Schema

Reference for blog post frontmatter fields.

The schema lives in src/content.config.ts, and it is strict: an unknown key or an unregistered tag fails the build. After editing frontmatter, run just check --only content; a failure names the post, the field, and the fix. just check --only scripts guards those messages: it plants one invalid post per message in a throwaway copy of the site, so an Astro or Zod upgrade that changes them fails the check.

Required Fields

FieldTypeFormatDescription
titlestring—Post title
tagsstring[]—At least 1 tag; each must be a slug in src/tags.ts
date_createddate2026-01-11Publication date
authorstring—Post author, usually Pascal Andy
descriptionstring—SEO meta and post cards (not shown in the body)

Optional Fields

FieldTypeDefaultDescription
lang"fr-CA" | "en"fr-CAPage language and Open Graph locale
featuredboolean—Show on the homepage featured section
draftboolean—Exclude the post from every build, dev included: no page, no listing, no RSS
ogImageimage | string—Custom OG image (local or URL)
canonicalURLstring—The original source of duplicated content, so search engines credit it
mermaidbooleanfalseEnable Mermaid diagram rendering

Scheduled Posts

A post whose date_created is in the future stays out of the home page, the blog roll, the tag pages, and RSS in production until 15 minutes before that date (SITE.scheduledPostMargin in src/config.ts). Its page is still built at its URL. The dev server lists it right away.

Examples

Minimal (5 required fields)

(in this order by default)

---
title: "My Post Title"
tags:
  - random
date_created: 2025-01-15
author: Pascal Andy
description: "Brief description for SEO and cards"
---

Full (all fields)

---
title: "My Post Title"
tags:
  - technologie
  - dev-notes
date_created: 2025-01-15
author: Pascal Andy
lang: en
featured: true
draft: false
ogImage: "./custom-og.png"
canonicalURL: "https://original-source.com/post"
mermaid: true
description: "Brief description for SEO and cards"
---

Notes