Skip to content

Repository files navigation

blog-template

English · 繁體中文

A bilingual blog template built with Astro. Markdown/MDX content, light and dark themes, RSS, sitemap, and structured data.

Live example: gimmy.blog

Features

  • Markdown and MDX content with category-based routing
  • Light and dark themes with system preference detection
  • Optional per-post bilingual toggle (EN / 中文)
  • RSS feed, sitemap, Open Graph tags, JSON-LD structured data
  • Static HTML output, no client-side framework runtime
  • TypeScript content collections with a typed frontmatter schema

Getting started

Click Use this template at the top of the repository to create your own copy, then:

git clone https://github.com/<you>/<your-blog>.git
cd <your-blog>
npm install
npm run dev

The development server runs at http://localhost:4321.

Configuration

Site-level settings are centralized in src/config.ts:

  • SITE.url, SITE.title, SITE.description
  • SITE.lang and SITE.ogLocale
  • SITE.author — name, role, email
  • SITE.social — Twitter, GitHub, Substack, Mastodon
  • CATEGORIES — section keys, display names, and descriptions

The about-page bio is in src/pages/about.astro.

Static assets

Replace the following files in public/:

File Purpose
avatar.png About-page portrait
og-default.png Default social-share image (1200×630)
favicon.ico, favicon-*.png, apple-touch-icon.png Favicons
site.webmanifest Web app manifest
fonts/*.woff2 Web fonts referenced in src/styles/global.css

Writing posts

Posts live in src/content/<category>/ as .md or .mdx files. The folder name maps to the category; the filename becomes the URL slug (override with urlSlug in frontmatter).

src/content/
├── article/
├── thought/
└── reading/

To add or rename a category, edit CATEGORIES in src/config.ts and rename the matching folder.

The frontmatter schema is defined in src/content.config.ts. Reference posts:

File Demonstrates
welcome.mdx Minimal post
example-article.mdx Full frontmatter reference
bilingual-example.mdx Bilingual toggle
example-reading.mdx Short reading note

Set draft: true to exclude a post from listings and routes.

Customizing the design

Building and deploying

npm run build
npm run preview

The static output deploys to Vercel, Netlify, Cloudflare Pages, GitHub Pages, or any static host.

Credits

The design draws from:

License

MIT

About

Minimal Astro blog template. Markdown / MDX, bilingual posts, light + dark themes, RSS, sitemap. Used by gimmy.blog.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages