Hexo 写作速查
新建内容
1 2 3
| hexo new "我的第一篇文章" hexo new page "about" hexo new draft "草稿"
|
本地预览与构建
1 2 3
| npm run server npm run clean npm run build
|
改完文章后,如果预览页面没更新,先 hexo clean 再 hexo server。
Front-matter 常用字段
1 2 3 4 5 6 7 8 9 10 11
| --- title: 文章标题 date: 2026-10-30 21:30:00 update: 2026-10-30 21:30:00 tags: [Hexo, 教程] categories: [教程] description: 文章摘要 cover: /img/cover.png top: true comments: true ---
|
插入图片的两种方式
- 放到
source/img/ 下,正文写 ;
- 开启
post_asset_folder: true(_config.yml),文章会带同名资源文件夹,正文写 。
常用 Markdown 扩展(Solitude 已支持)
- 代码块:三反引号 + 语言名,如
```bash
- 提示块:暂时用普通的引用
> 提示 即可
- 数学公式:
$E=mc^2$(需要在主题配置里开启 katex)
- 图片点开看大图:主题配置里开启
fancybox 或 mediumZoom