Skip to content
Installation

Installation

Install from GitHub

npm install github:eskopp/AstroBlogTheme

Or pin a tag or commit in package.json:

{
  "dependencies": {
    "astro-blog-theme": "github:eskopp/AstroBlogTheme#v0.2.62"
  }
}

Wire it up

astro.config.mjs

import { defineConfig } from "astro/config";
import blogTheme from "astro-blog-theme";

export default defineConfig({
  site: "https://your-domain.example",
  integrations: [
    blogTheme({
      title: "My Blog",
      description: "Notes and longer pieces.",
      author: "Your Name",
      nav: [
        { href: "/", label: "Home" },
        { href: "/blog", label: "Blog" },
      ],
      social: [{ href: "/rss.xml", label: "RSS" }],
    }),
  ],
});

src/content.config.ts — declare a blog collection with the theme’s schema:

import { defineCollection } from "astro:content";
import { glob } from "astro/loaders";
import { blogSchema } from "astro-blog-theme/content";

const blog = defineCollection({
  loader: glob({ base: "./src/content/blog", pattern: "**/*.{md,mdx}" }),
  schema: blogSchema,
});

export const collections = { blog };

src/env.d.ts — so the editor knows the virtual config module:

/// <reference types="astro-blog-theme/virtual.d.ts" />
Add posts to src/content/blog/*.md. Put favicon.svg (and optionally og-default.svg) in public/.

Options

OptionTypeDefault
titlestring"Astro Blog Theme"
descriptionstring"A blog built with Astro."
authorstring""
langstring"en"
localestring"en_US"
nav{ href, label }[]Home + Blog
social{ href, label }[]RSS
postsPerPagenumber5
postList"cards" | "rows""cards"
searchbooleantrue
injectRoutesbooleantrue
sitemapbooleantrue
mdxbooleantrue
imageCreditsbooleantrue

The full, always-current list — including mermaid, chessEngine, math, pwa, security, locales — lives in the AstroBlogTheme README.