Hello World

为什么写博客

搭建一个极简、快速、纯 Markdown 驱动的个人博客。所有内容都是 .md 文件,GitHub 管理版本,推送即部署。

技术选型

选型时比较了几个主流方案:

框架 构建速度 语言 适合场景
Hugo 极快 (<1s/千页) Go 大型内容站
Hexo 快 (~45s/千页) Node.js 中型博客
Astro 较快 (~20s/千页) JS/TS 性能优先

最终选择 Hexo — Node 生态、EJS 模板、丰富的中文社区资源。

设计原则

暖色调奶油画布 + 珊瑚色点缀 + 深海军蓝产品表面。衬线标题配无衬线正文,像一本文学杂志,而不是 SaaS 模板。

  • 零 JS 框架 — 标签筛选和主题切换用原生 JS,总共不超过 100 行
  • 无 CSS 预处理器 — CSS 自定义属性处理主题切换
  • 无阴影 — 层次感来自表面颜色对比,而非 box-shadow

代码示例

1
2
3
4
5
6
7
// 主题切换 — 全部 JavaScript (~20 行)
function toggleTheme() {
const current = document.documentElement.dataset.theme;
const next = current === 'dark' ? 'light' : 'dark';
document.documentElement.dataset.theme = next;
localStorage.setItem('theme', next);
}
1
2
3
4
5
6
7
8
# 创建新文章
hexo new post "My New Post"

# 本地预览
hexo server

# 生成静态文件
hexo generate

图片支持

支持本地图片和外部 URL 图片:

  • 本地图片: ![](/images/example.jpg)
  • 外部图片: ![](https://example.com/photo.jpg)

接下来

  1. 完善主题设计 — 基于 Claude 设计语言
  2. 实现标签筛选功能
  3. 实现深色/浅色模式切换
  4. 配置 CI/CD 自动部署