使用 MDX 编写博客文章,frontmatter 支持标题、slug、描述、日期、标签、搜索索引与封面图等字段
astro-theme-minimal-blog — Astro 博客模板
作者 LekoArts
基于 Astro 的极简博客主题,支持 MDX 写作、Tailwind 样式、代码高亮、Sandpack 实时代码演示、标签、RSS、站点地图与 Pagefind 搜索。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 3
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
集成 Tailwind 样式、Expressive Code 代码块与自定义 Aside 提示组件
通过 Sandpack 提供 Playground 组件,可在文章中嵌入可运行的代码示例
内置 RSS、Sitemap、Pagefind 搜索与浅色/深色/跟随系统三种配色模式
提供 pnpm assistant 命令行脚本,以问答方式生成新文章文件与 frontmatter
模板详细介绍
Astro Theme: Minimal Blog 是 LekoArts 发布的 Astro 博客主题,仓库采用 MIT 许可。它面向希望快速搭建个人博客的开发者,提供文章写作、标签、搜索、订阅与站点地图等常见博客能力。
内容以 MDX 编写,样式使用 Tailwind,代码块由 Expressive Code 渲染,并内置 Aside 提示块与基于 Sandpack 的 Playground 组件用于实时代码演示。主题附带命令行助手脚本,通过问答方式生成文章 frontmatter 与文件。站点标题、导航与标签映射集中在 constants.ts 中维护,frontmatter 字段可在 content.config.ts 中调整。
使用前需安装 pnpm,克隆仓库后执行 pnpm install 安装依赖,再用 pnpm dev 启动开发服务器。演示图片、字体、图标等第三方素材需按各自许可单独核对,域名、托管等外部服务可能另行收费。
适合你的项目吗?
适用场景
- 搭建以 Markdown/MDX 写作为主的个人技术博客
- 在文章中嵌入可交互的代码演示或教学示例
- 需要标签分类、站内搜索与 RSS 订阅的静态博客站点
- 作为 Astro 博客项目的起始模板进行二次开发
适合人群
- 熟悉 Astro 与 pnpm 的前端开发者
- 需要 MDX 写作与代码高亮能力的博客作者
- 希望以 MIT 许可代码为基础自行修改和部署的个人项目
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
需先安装 pnpm,再克隆仓库并执行 pnpm install 安装依赖
- 2
使用 pnpm dev 启动本地开发服务器
- 3
部署前修改 src/constants.ts 中的站点标题、导航与标签映射
- 4
新增标签需在 constants.ts 的 FRONTMATTER_TAGS 中同时配置显示名与 slug
- 5
调整文章 frontmatter 字段需修改 src/content.config.ts
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 使用该主题前必须安装 pnpm 包管理器,并以此完成依赖安装与开发服务器启动。
- 需从 GitHub 克隆该仓库获取源码,属于外部代码托管服务依赖。
- 文章内实时代码演示依赖 Sandpack 第三方库,其运行可能涉及外部服务。
- 站内搜索功能依赖 Pagefind 第三方工具,需按其自身许可与要求使用。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
Ensure that [pnpm](https://pnpm.io/installation) is installed
README 原文
Clone the [astro-theme-minimal-blog](https://github.com/LekoArts/astro-theme-minimal-blog) repository.
README 原文
Live coding powered by [Sandpack](https://github.com/codesandbox/sandpack)
README 原文
https://github.com/LekoArts/astro-theme-minimal-blog/blob/main/LICENSEhttps://github.com/LekoArts/astro-theme-minimal-blog/blob/main/README.md[Pagefind](https://pagefind.app/) search
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-02。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 92 / 100
- 技术栈
- Astro
- 网站类型
- 博客 · 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-09-05
- 截图检查日期
- 2026-10-02
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Astro。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。
查看当时使用的来源资料
SHA-256: 8b26c4a9b5b7e279afc247371897f36c3f66ce88b43553c88a714ebd3f9f5a22
2026-10-02T09:46:48.203Z
来源文件 / 仓库# Astro Theme: Minimal Blog
Welcome to **Astro Theme: Minimal Blog**, an ideal option to start sharing your ideas. It's easy to set up and features everything you'd need for a blog.
[**Demo Website**](https://astro-theme-minimal-blog.lekoarts.de)
## ✨ Features
- Write blog posts with MDX
- Styled with [Tailwind](https://tailwindcss.com/)
- Code blocks powered by [Expressive Code](https://expressive-code.com/)
- Custom asides component
- Live coding powered by [Sandpack](https://github.com/codesandbox/sandpack)
- RSS, Sitemap
- Light/Dark/System color mode toggle
- Add tags to your blog posts
- [Pagefind](https://pagefind.app/) search
## 🚀 Getting started
1. **Important:** Ensure that [pnpm](https://pnpm.io/installation) is installed
1. Clone the [astro-theme-minimal-blog](https://github.com/LekoArts/astro-theme-minimal-blog) repository.
1. Install dependencies.
```shell
pnpm install
```
1. Run the development server.
```shell
pnpm dev
```
## 📝 Using & modifying this theme
### Add content
This theme features a CLI to help you scaffold new blog posts. It asks you questions to fill out the frontmatter and creates a file in the end. Run the CLI:
```shell
pnpm assistant
```
If you want to extend it, change the [`assistant.ts`](./scripts/assistant.ts) file.
### Change constants
Parts of the theme are referencing [`constants.ts`](./src/constants.ts) to e.g. set the site title or main navigation. Modify its contents to suit your site before deploying it.
### Change existing tags / Add new tags
Inside [`constants.ts`](./src/constants.ts) the `FRONTMATTER_TAGS` map contains the available tags for your site. You need to add your display name and slug of the tag inside this map. The display name will be used in the UI and the slug will be used in the URL.
It's referenced by Astro's content collections and also by the [`assistant.ts`](./scripts/assistant.ts) file.
You can add a new tag like so:
```ts
export const FRONTMATTER_TAGS = new Map(
[
// Existing tags...
['Display name', 'slug-of-your-tag'] as const,
],
)
```
## 🔍 Reference
### Blog post frontmatter
By default, these frontmatter fields are available. You need to change [`content.config.ts`](./src/content.config.ts) to adjust it.
```yaml
title: Markdown Reference Overview
slug: markdown-reference-overview
description: A post showcasing the markdown formatting of a post
date: 2025-02-18
lastUpdated: 2025-02-18
tags:
- General
- MDX
searchIndex: true
image: https://absolute-link.google.com/image.png
```
### Custom MDX components
#### `<Aside>`
```md
:::note
Text
:::
:::caution[Watch out!]
Text
:::
:::tip
Text
:::
:::danger
Text
:::
```
Read the [Aside Example](./content/blog/2025-04-02--mdx-asides/index.mdx) to learn more.
#### `<Playground>`
````md
<Playground template="react">
```js name=App.js active
export default function App() {
return <h1>Hello World</h1>
}
```
</Playground>
````
Read the [Playground Example](./content/blog/2025-06-23--live-coding-with-sandpack/index.mdx) to learn more.
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

astrowind
⭕️ AstroWind: A free template using Astro v7 and Tailwind CSS v4. Astro starter theme.
Astro · 博客

astro-paper
A minimal, accessible and SEO-friendly Astro blog theme.
Astro · 博客

fuwari
✨A static blog template built with Astro.
Astro · 博客

Firefly
Firefly 是一款基于 Astro 的静态博客主题,由 CuteLeaf 在 saicaca 的 Fuwari 模板基础上二次开发,主打清新美观的视觉风格。
Astro · 博客

astro-theme-cactus
A simple Astro theme. Use it to create your blog or website.
Astro · 作品集

astrofy
Astrofy is a free and open-source template for your Personal Portfolio Website built with Astro and TailwindCS…
Astro · 作品集
