Skip to content
AstroPaper
Go back

Understanding All Frontmatter Fields in AstroPaper

Updated:
Edit page

Frontmatter is the block of metadata at the top of every blog post, enclosed between --- lines. AstroPaper uses it to control how your post is displayed, indexed, and shared. Here is a breakdown of every supported field.

Table of contents

Open Table of contents

Required Fields

These fields must be present in every post or the build will fail.

title

title: "My Post Title"

The title of your post. Shown in the browser tab, post header, post cards, and OG images.

description

description: "A short summary of what this post is about."

A brief summary of the post. Used in SEO meta tags, OG/social preview cards, and post listings.

pubDatetime

pubDatetime: 2026-04-01T10:00:00Z

The publication date and time in ISO 8601 format. Posts are sorted by this field — newest first. Scheduled posts (set in the future) are hidden until their time arrives, within a scheduledPostMargin window defined in config.ts.

Optional Fields

These fields are optional. Omitting them uses a default value or simply disables the feature.

author

author: "Evanara Kumestra"

The name of the post’s author. Defaults to SITE.author from src/config.ts if not set. Useful when a blog has multiple contributors.

modDatetime

modDatetime: 2026-04-01T12:00:00Z

The date the post was last modified. When set, AstroPaper displays a “Updated” timestamp alongside the original publish date. Set to null to explicitly clear it.

featured: true

When true, the post appears in the Featured section on the homepage, above the recent posts list. Only a handful of posts should be featured at once.

draft

draft: true

When true, the post is excluded from production builds and does not appear anywhere on the site. It is still visible during local development. Use this for work-in-progress posts.

tags

tags: ["guide", "astropaper", "blogging"]

An array of tags for the post. Tags are used to group posts and generate tag pages at /tags/<tag>. Defaults to ["others"] if omitted.

ogImage

ogImage: "my-custom-image.jpg"

A custom image used when the post is shared on social media (Open Graph). Can be a path to a file in public/ or an imported image. If omitted and dynamicOgImage is enabled in config.ts, an OG image is generated automatically from the post title.

canonicalURL

canonicalURL: "https://example.com/original-post"

Overrides the canonical URL in the page’s <head>. Use this when republishing content that originally appeared elsewhere, to tell search engines where the original lives.

hideEditPost

hideEditPost: true

When true, hides the “Edit page” link that normally appears at the bottom of the post. The global edit link is configured in config.ts under editPost. Use this to hide it on specific posts where editing doesn’t make sense.

timezone

timezone: "Asia/Bangkok"

The IANA timezone used to interpret pubDatetime and modDatetime for this post. Overrides the global SITE.timezone from config.ts. Useful when publishing from a different timezone or scheduling posts precisely. A full list of valid values can be found at Wikipedia — List of tz database time zones.

Quick Reference

FieldRequiredDefault
titleyes
descriptionyes
pubDatetimeyes
authornoSITE.author
modDatetimenonull
featurednofalse
draftnofalse
tagsno["others"]
ogImagenoauto-generated
canonicalURLnocurrent page URL
hideEditPostnofalse
timezonenoSITE.timezone

Edit page
Share this post on:

Previous Post
Getting VS Code Markdown Preview to Match GitHub
Next Post
How to configure AstroPaper theme