Installation
Installation
Install from GitHub
npm install github:eskopp/AstroBlogThemeOr 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
| Option | Type | Default |
|---|---|---|
title | string | "Astro Blog Theme" |
description | string | "A blog built with Astro." |
author | string | "" |
lang | string | "en" |
locale | string | "en_US" |
nav | { href, label }[] | Home + Blog |
social | { href, label }[] | RSS |
postsPerPage | number | 5 |
postList | "cards" | "rows" | "cards" |
search | boolean | true |
injectRoutes | boolean | true |
sitemap | boolean | true |
mdx | boolean | true |
imageCredits | boolean | true |
The full, always-current list — including mermaid, chessEngine, math,
pwa, security, locales — lives in the
AstroBlogTheme README.