Mermaid 图表在构建时渲染,并跟随明暗主题
eleventy-tech-blog — Eleventy 博客模板
作者 tepiton
基于 Eleventy 的开发者博客启动器,面向技术写作,内置 Mermaid 图表、代码高亮、明暗主题、RSS 订阅与图片优化。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 3
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
PrismJS 代码高亮,带语言标记的代码块自动处理
浅色、深色、跟随系统三种主题,偏好保存在 localStorage
RSS/Atom 订阅源并带自定义 XSL 样式
自动生成 AVIF/WebP 图片并懒加载
根据文章 front matter 自动生成标签页,draft: true 排除出生产构建
模板详细介绍
这是一个 Eleventy 博客启动器,定位为开发者技术写作站点。内容以 Markdown 文件放在 content/posts/ 目录,通过 front matter 设置标题、日期、标签与描述;日期决定排序,标签自动生成标签页,draft: true 的文章不会进入生产构建。站点元数据(标题、站点名、URL、语言、描述、作者信息)集中在 content/_data/metadata.js 中修改。
技术写作相关能力包括:Mermaid 图表通过 @kevingimbel/eleventy-plugin-mermaid 在构建时渲染,并跟随当前明暗主题;代码块由 PrismJS 高亮,需带语言标记;主题支持浅色、深色与跟随系统三种模式,通过页头下拉切换并保存在 localStorage。样式与字体以 CSS 自定义属性集中在 css/index.css 顶部,字体使用 Google Fonts 的 Source Sans 3 与 JetBrains Mono,替换需同时改 _includes/layouts/base.njk 中的 link 标签。
项目还提供 RSS/Atom 订阅(带自定义 XSL 样式)、自动生成 AVIF/WebP 并懒加载的图片优化,以及 Netlify 和 Vercel 的部署配置文件;GitHub Pages 需自行添加构建工作流。npm 脚本包含开发服务器(0.0.0.0:8088,带热重载)、生产构建、调试构建与基准测试。仓库采用 MIT 许可,演示图片、字体、图标等第三方素材需单独核对许可。
适合你的项目吗?
适用场景
- 搭建个人开发者博客并发布 Markdown 技术文章
- 撰写含流程图、时序图等 Mermaid 图表的技术文档
- 需要代码高亮与明暗主题切换的教程类站点
- 通过 RSS 订阅分发文章内容
适合人群
- 习惯用 Markdown 写作的开发者
- 需要图表与代码高亮的技术博客作者
- 偏好 Eleventy 静态站点生成器的用户
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
克隆仓库后执行 npm install,再运行 npm run start,访问 http://localhost:8088
- 2
站点标题、URL、作者等信息在 content/_data/metadata.js 中修改
- 3
文章放在 content/posts/,front matter 需包含 title、date、tags,可选 description
- 4
字体使用 Google Fonts,替换需修改 _includes/layouts/base.njk 中的 link 标签并同步 CSS 变量
- 5
Netlify 与 Vercel 配置已包含;GitHub Pages 需自行添加 .github/workflows/pages.yml
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 模板默认通过 Google Fonts 加载 Source Sans 3 与 JetBrains Mono 字体,页面会向 Google 的外部字体服务发起请求;若需离线或避免第三方请求,须自行替换 _includes/layouts/base.njk 中的 link 标签并同步更新 CSS 变量。
- 仓库仅内置 Netlify 与 Vercel 的部署配置;部署到 GitHub Pages 需自行添加 .github/workflows/pages.yml 构建工作流,属于额外配置工作。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
This template uses Google Fonts (Source Sans 3, JetBrains Mono).
README 原文
https://github.com/tepiton/eleventy-tech-blog/blob/main/LICENSEhttps://github.com/tepiton/eleventy-tech-blog/blob/main/README.mdNetlify and Vercel config files are included. For GitHub Pages, add a `.github/workflows/pages.yml` build workflow.
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-01。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 85 / 100
- 技术栈
- Eleventy
- 网站类型
- 博客 · 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-09-12
- 截图检查日期
- 2026-10-01
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Eleventy。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。
查看当时使用的来源资料
SHA-256: 3b542d6e5e7c5d6ad845ea227a501aac36144216f1b501782ed292fa7ba01131
2026-10-01T14:08:05.169Z
来源文件 / 仓库# eleventy-tech-blog
An Eleventy v3 starter for developer blogs. Designed for technical writing: Mermaid diagrams, syntax highlighting, light/dark theming, RSS feeds, and image optimization.
## Quick start
```
git clone <this-repo> my-project
cd my-project
npm install
npm run start
```
Then open `http://localhost:8088`.
## Customization
### Site metadata
Edit `content/_data/metadata.js`:
```js
export default {
title: "Your Dev Blog",
siteName: "yoursite.dev",
url: "https://example.com/",
language: "en",
description: "A description of your blog.",
author: {
name: "Your Name",
email: "[email protected]",
url: "https://example.com/about/",
},
}
```
### Writing posts
Add Markdown files to `content/posts/`. Each post needs front matter:
```yaml
---
title: The Title of This Post
date: 2025-01-15
tags:
- git
- javascript
description: Optional. Used in the HTML meta description and feed.
---
```
- `date` controls sort order
- `tags` generate automatic tag pages
- Add `draft: true` to exclude from production builds
### Mermaid diagrams
Diagrams are rendered via `@kevingimbel/eleventy-plugin-mermaid`. Use fenced code blocks:
````markdown
```mermaid
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[Do this]
B -->|No| D[Do that]
```
````
Diagrams respect the active light/dark theme.
### Syntax highlighting
PrismJS handles code blocks. Fenced code blocks with a language tag get highlighted:
````markdown
```javascript
const x = 1
```
````
### Themes
The site supports light, dark, and system-preference modes. Users switch via the header dropdown; preference is persisted in localStorage.
Colors and fonts are CSS custom properties at the top of `css/index.css`:
```css
:root {
--font-body: Source Sans 3, 'Helvetica Neue', sans-serif;
--font-mono: JetBrains Mono, monospace;
--color-bg: #ffffff;
--color-text: #1a1a1a;
}
```
**Fonts:** This template uses Google Fonts (Source Sans 3, JetBrains Mono). The `<link>` tags are in `_includes/layouts/base.njk`. To swap fonts, replace those tags and update the CSS variables.
## Project structure
```
content/
_data/
metadata.js # Title, author, URL, feed config
posts/
my-first-post.md
...
pages/ # Static pages (About, etc.)
_includes/
layouts/
base.njk # HTML shell with theme switcher
post.njk # Post layout
_config/
filters.js # Date formatting, tag filtering
css/
index.css # All styles, theme variables
js/
theme-switcher.js # Theme persistence
```
## npm scripts
| Command | Description |
|:--------|:------------|
| `npm run start` | Dev server at `0.0.0.0:8088` with live reload |
| `npm run build` | Production build to `_site/` |
| `npm run debug` | Build with Eleventy debug output |
| `npm run benchmark` | Performance benchmarking |
## Features
- **Mermaid diagrams** — rendered at build time, theme-aware
- **Syntax highlighting** — PrismJS with custom theme
- **Theme switching** — light, dark, system preference, persisted in localStorage
- **RSS/Atom feeds** — with custom XSL styling
- **Image optimization** — automatic AVIF/WebP generation with lazy loading
- **Tag pages** — automatic generation from post front matter
- **Drafts** — excluded from production builds via `draft: true`
## Deploy
Netlify and Vercel config files are included. For GitHub Pages, add a `.github/workflows/pages.yml` build workflow.
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

eleventy-base-blog
A starter repository for a blog web site using the Eleventy static site generator.
Eleventy · 博客

eleventy-garden
:seedling: A starter site for building a mind garden with eleventy
Eleventy · 启动器

eleventastic
An Eleventy Starter Kit
Eleventy · 启动器

neat-starter
Starter Template for Netlify CMS, Eleventy, Alpine JS & Tailwind CSS
Eleventy · 启动器

Eleventy-Starter-Boilerplate
🚀 Eleventy Starter is production-ready with SEO-friendly for quickly starting a blog. ⚡ Built with Eleventy, …
Eleventy · 博客

eleventy-plus-vite
A clean and fast Eleventy Starter Project with Vite
Eleventy · 启动器
