Installation
Installation
Installation von GitHub
npm install github:eskopp/AstroBlogThemeOder in package.json auf ein Tag oder einen Commit pinnen:
{
"dependencies": {
"astro-blog-theme": "github:eskopp/AstroBlogTheme#v0.2.62"
}
}Einbinden
astro.config.mjs
import { defineConfig } from "astro/config";
import blogTheme from "astro-blog-theme";
export default defineConfig({
site: "https://deine-domain.example",
integrations: [
blogTheme({
title: "Mein Blog",
description: "Notizen und längere Texte.",
author: "Dein Name",
nav: [
{ href: "/", label: "Home" },
{ href: "/blog", label: "Blog" },
],
social: [{ href: "/rss.xml", label: "RSS" }],
}),
],
});src/content.config.ts — eine blog-Collection mit dem Schema des Themes deklarieren:
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 — damit der Editor das virtuelle Config-Modul kennt:
/// <reference types="astro-blog-theme/virtual.d.ts" />
Beiträge kommen nach
src/content/blog/*.md. favicon.svg (optional auch
og-default.svg) gehört nach public/.Optionen
| Option | Typ | Standard |
|---|---|---|
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 |
Die vollständige, immer aktuelle Liste — inklusive mermaid, chessEngine,
math, pwa, security, locales — steht in der
AstroBlogTheme-README.