init
This commit is contained in:
76
posts/2026/05/introducing-ddmt-blog.md
Normal file
76
posts/2026/05/introducing-ddmt-blog.md
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
title: "Ddmt-Blog: A Git-Driven Markdown Blog"
|
||||
date: 2026-05-15
|
||||
description: "Introduction to Ddmt-Blog, a lightweight blog system powered by Bun, Astro, and Git webhooks."
|
||||
category: "tech"
|
||||
tags: ["blog", "astro", "bun", "git", "markdown"]
|
||||
pinned: true
|
||||
author: "ddmt"
|
||||
---
|
||||
|
||||
## What is Ddmt-Blog
|
||||
|
||||
Ddmt-Blog is a lightweight, HTML-first blog system built on top of Bun and Astro. It uses Markdown files as the single source of truth for all content, with Git as the content management layer.
|
||||
|
||||
No database. No admin panel. Just Markdown, Git, and a fast build pipeline.
|
||||
|
||||
## Core Principles
|
||||
|
||||
- **Git-driven content** -- Your Gitea (or compatible) repository IS your CMS. Push a Markdown file, and the blog rebuilds automatically via webhook.
|
||||
- **Markdown as data** -- Every post, page, and piece of structured data lives in `.md` or `.yaml` files under the `content/` directory.
|
||||
- **Static-first, SPA-enhanced** -- The site builds to static HTML by default, with Astro's ClientRouter for smooth client-side page transitions.
|
||||
- **Zero database** -- No SQL, no Redis, no external storage. Everything is files on disk.
|
||||
- **Lightweight runtime** -- A single Bun process serves static files, handles webhooks, and triggers rebuilds.
|
||||
|
||||
## Tech Stack
|
||||
|
||||
| Layer | Technology |
|
||||
|---|---|
|
||||
| Runtime | Bun |
|
||||
| Framework | Astro 6 |
|
||||
| Styling | TailwindCSS 4 |
|
||||
| Search | Pagefind |
|
||||
| Code Highlight | Shiki |
|
||||
| Content Sync | Git SSH + Gitea Webhook |
|
||||
|
||||
## How It Works
|
||||
|
||||
1. You write a Markdown file and push it to your Git repository.
|
||||
2. Gitea sends a webhook POST to the blog server.
|
||||
3. The server verifies the signature, pulls the latest content, and triggers a full Astro rebuild.
|
||||
4. The new static files are served immediately.
|
||||
|
||||
The entire cycle -- from push to live -- takes a few seconds.
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
content/
|
||||
posts/ # Markdown articles (yyyy/mm/slug.md)
|
||||
pages/ # Template pages (about.md, friends.md)
|
||||
data/ # Structured data (friends.yaml, site.json)
|
||||
assets/ # Static images and files
|
||||
src/
|
||||
pages/ # Astro routes and templates
|
||||
layouts/ # Page layouts
|
||||
components/ # UI components
|
||||
server/ # Webhook and sync logic
|
||||
app/
|
||||
server.ts # Bun HTTP server entry point
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- Author card and website info from webhook data
|
||||
- Category and tag system
|
||||
- Full-text search via Pagefind
|
||||
- Dark/light theme toggle
|
||||
- RSS feed and sitemap
|
||||
- SEO meta tags and OpenGraph
|
||||
- Friends page with YAML-driven link groups
|
||||
- Archive and timeline views
|
||||
- Build info footer (commit SHA + build time)
|
||||
|
||||
## Next Steps
|
||||
|
||||
Check out the [configuration guide](/article/ddmt-blog-setup) for deployment instructions, environment variables, and Docker setup.
|
||||
Reference in New Issue
Block a user