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/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 remains Cmd/Ctrl+K. 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 for filtering and tag-page generation. |
image | string | undefined | Hero image URL for OG and post header. |
imageAlt | string | undefined | Alt text for the hero image. Required when image is set. |
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.