插件安装
1 | npm install hexo-asset-img --save |
该插件可以将相对路径转换为绝对路径使得浏览器可以访问到。
配置Hexo
修改根目录下的_config.yml
文件。
将post_asset_folder
设置为true
。该配置会在使用hexo new "filename"
时自动生成同名的文件夹保存资源。
配置Typora
将Typora的图像设置改为保存到与该文件同目录的同名文件夹中。
Hexo配置渲染数学公式
卸载默认渲染器,安装Pandoc渲染器
1
2npm uninstall hexo-renderer-marked --save
npm install hexo-renderer-pandoc --save安装mathjax包
1
npm install hexo-filter-mathjax
在根目录
_config.yml
下添加1
2
3
4
5
6
7mathjax:
tags: none # or 'ams' or 'all'
single_dollars: true # enable single dollar signs as in-line math delimiters
cjk_width: 0.9 # relative CJK char width
normal_width: 0.6 # relative normal (monospace) width
append_css: true # add CSS to every page
every_page: true # if true, every page will be rendered by mathjax regardless the `mathjax` setting in Front-matter of each article在博客front-matter上添加
1
mathjax: true
配置显示emoji
安装库
npm install hexo-filter-emoji
在_config.yml
添加以下内容:
1 | # hexo-filter-emoji |