0%

Hexo-NexT切换渲染器

Hexo默认的渲染器不支持emoji,可以切换渲染器来支持emoji

学习自 原作者链接

切换渲染器

1
2
3
npm un hexo-renderer-marked --save
npm i hexo-renderer-markdown-it --save
npm install markdown-it-emoji --save

修改Hexo根目录下的_config.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
## markdown 渲染引擎配置,默认是hexo-renderer-marked,这个插件渲染速度更快,且有新特性
markdown:
render:
html: true # 不转义 HTML 内容,即允许 HTML,false 转义 HTML,< > 尖括号会被转义成 &lt; &gt;等

xhtmlOut: false
breaks: true
linkify: true
typographer: true
quotes: '“”‘’'
plugins:
- markdown-it-footnote
- markdown-it-sup
- markdown-it-sub
- markdown-it-abbr
- markdown-it-emoji #开启emoji
anchors:
level: 2
collisionSuffix: 'v'
permalink: true
permalinkClass: header-anchor
permalinkSymbol: ¶

配置完毕后需要输入

1
hexo clean && hexo s

重启Hexo

emoji使用规则:Emoji Cheat Sheet