blog template
Blog and newsletter site with post listings, RSS feed, sitemap, and Pagefind-powered search.
The blog template scaffolds a content-focused blog. It’s the right choice when the primary surface is chronological posts — engineering blog, dev diary, newsletter, or release notes.
Scaffold
publier new my-blog --template blogDirectory layout
my-blog/ src/ content/ blog/ # MDX posts → /blog/<slug> my-first-post.mdx publier.config.yaml theme.yaml astro.config.ts content.config.tsPublier auto-provides:
/blog/— post listing page/blog/<slug>— individual post route (one per.mdxfile)/blog/tag/<tag>— one listing per tag used by a published post, newest first. The heading is the tag with a capital letter, and the URL segment is the tag in lower case with runs of other characters turned into one hyphen, soRelease noteslives at/blog/tag/release-notes/blog/rss.xml— RSS feed (auto-generated from the collection)
astro.config.ts
Keep the generated integration array: docsShell() first, then Expressive Code, MDX, sitemap, Pagefind, and Qwik. These integrations are registered explicitly; the shell warns when one is missing and does not add it. See Configuration for the complete configuration and required order.
content.config.ts
import { defineCollection } from 'astro:content';import { blogLoader } from '@publier/shell/loaders';import { blogSchema } from '@publier/shell/schemas';
export const collections = { blog: defineCollection({ loader: blogLoader(), schema: blogSchema }),};blogLoader() reads from ./src/content/blog by default. Each .mdx filename becomes the URL slug — src/content/blog/ship-v1.mdx renders at /blog/ship-v1.
publier.config.yaml
The project requires a site mapping with a non-empty site.name:
site: name: My Blog url: https://blog.example.com favicon: /favicon.svgKeep the generated navigation, then customize it using Global settings. search.enabled controls the header trigger; the shortcut is Cmd/Ctrl+K unless you set search.hotkey. The template’s pages: flags do not create or suppress routes. See Pages for the current route controls and limits.
Blog frontmatter (blogSchema)
| Field | Type | Default | Description |
|---|---|---|---|
title | string | required | Post title. |
date | string | Date | required | Publish date — ISO string or Date object; coerced to Date. |
description | string | undefined | Short description for listings, OG tags, and RSS. |
updated | string | Date | undefined | Last-updated date for “last modified” display. |
author | string | undefined | Author name. Multi-author: comma-separated string. |
tags | string[] | undefined | Tags. Each tag of a published post gets a listing at /blog/tag/<tag>; drafts add none. |
image | string | undefined | Hero image. Shown below the title block and used for the og:image and twitter:image tags. A root-relative path such as /images/cover.png is made absolute against site.url in the tags. |
imageAlt | string | undefined | Alt text for the hero image, also written to og:image:alt and twitter:image:alt. Optional: an image without it renders with an empty alt text, which marks it as decorative, so add it unless the image is purely decorative. |
draft | boolean | false | Excluded from production builds; still served in publier dev. |
excerpt | string | undefined | Manual excerpt override; auto-generated from the first paragraph if omitted. |
Example post
---title: Publier v1 is livedescription: What we built, what we learned, and what's next.date: 2026-04-15author: The Teamtags: [release, announcement]image: /images/v1-hero.pngimageAlt: Terminal showing publier build---
After six months of development, Publier v1 is live...The RSS feed URL is /blog/rss.xml — linked in the default nav.