目录:
快速使用
本地部署
hexo s
一键部署
hexo cl && hexo d -g
创建文章
hexo new [theme] [title]
theme — 默认使用config.yml中的主题
title — 文章标题
生成静态网页
hexo g
清理静态网页
hexo cl
进阶使用
标签插件-包含资源
语法
{% asset_path filename %}
{% asset_img [class names] slug [width] [height] [title text [alt text]] %}
{% asset_link filename [title] [escape] %}
嵌入图片
首先需要开启文章资源文件,[官方文档-文章资源文件]
# _config.yml
post_asset_folder: true
当资源文件管理功能打开后,Hexo将会在你每一次通过 hexo new [layout] <title>
命令创建新文章时自动创建一个文件夹
然后就可以在文章中引用图片了,像这样
{% asset_img foo.jpg %}
主题
hexo-Theme-ParticleX
https://github.com/theme-particlex/hexo-theme-particlex
插件
hexo-renderer-marked
启用方式
# _config.yml
post_asset_folder: true
marked:
prependRoot: true
postAsset: true
hexo-renderer-marked 3.1.0 引入了一个新的选项,其允许你无需使用 asset_img 标签插件就可以在 markdown 中嵌入图片
启用后,资源图片将会被自动解析为其对应文章的路径。 例如: image.jpg 位置为 /2020/01/02/foo/image.jpg ,这表示它是 /2020/01/02/foo/ 文章的一张资源图片,  将会被解析为 <img src="/2020/01/02/foo/image.jpg">
。
安装
npm install hexo-renderer-marked --save