git的emoji图标注释

gitmoji

有时我们会想在git上使用emoji来轻松一下我们的内容,所以就涉及了这个网站

gitmoji | An emoji guide for your commit messages

这里是各种emoji的使用方式

例如:

🎨

🔥

🐛 (bug)

📝

🚀

💩

💡

💬

🔇

🤡

🔍

😃

💢

😠

:happy:

等一些emoji,其实很写法简单,就是 : 英文名称: 比如🐛 只需输入: bug :(要使用英文标点)

but

😱 但是有个问题…

Hexo默认的markdown渲染引擎hexo-renderer-marked已经不再支持将Github emoji渲染到静态的html中

所以直接使用在文章发布后你会发现没有emoji,所以得稍稍配置一下…(我直接百度🐶 )

使用插件

这里推荐的是 hexo-renderer-markdown-it 渲染器,支持扩展,采用的是 markdown-it 的内核来解析 markdown 的文本。

第一步

在你的blog目录下

先卸载掉原来的hexo-renderer-marked,然后下载新的插件hexo-renderer-markdown-itmarkdown-it-emoji

1
2
3
4
npm un hexo-renderer-marked -S
npm i hexo-renderer-markdown-it -S

npm i markdown-it-emoji markdown-it-task-lists -S

第二步

❗ 在你的根目录的 _config.yaml下添加下面这段配置(注意是根目录blog下的 _config.yaml)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#让hexo支持emoji增加的插件配置  
markdown:
render:
html: true # 在 markdown 文本中支持 html tag 标签
xhtmlOut: false # 需要 xtml 文档,使用 <br /> 替代 <br>
breaks: true # 用 <br> 开始新的一行
linkify: true # 自动将 可能是链接的内容转换成链接
typographer: true # 印刷标识转换
plugins:
- markdown-it-abbr
- markdown-it-footnote
- markdown-it-ins
- markdown-it-sub
- markdown-it-sup
- markdown-it-emoji
- markdown-it-task-lists
anchors:
level: 2
collisionSuffix: ''
permalink: false,
permalinkClass: 'header-anchor'
permalinkSymbol: ''
case: 0
separator: ''

然后提交就ok了

以上步骤应该就能支持emoji了

参考文章 :

hexo中使用emoji表情 | 苏苏の休憩小屋 (luckysusu.top)

Hexo 中使用 emoji 和 tasks - 知乎 (zhihu.com)

部分emoji使用编码参考 🧐

人物 自然 事物 地点
😐 :neutral_face: ☀️ :sunny: 💝 :gift_heart: 🏠:house:
😄 :smile: ❄️ :snowflake: 🎁 :gift: 🏫:school:
😍 :heart_eyes: ☔️ :umbrella: 🎏 :flags: 🏥:hospital:
😘 :kissing_heart: ☁️ :cloud: 🔔 :bell: 🗾:japan:
😓 :sweat: ⚡️ :zap: 🎄 :christmas_tree: 🏭:factory:
😤 :triumph: 🐷 :pig: ☎️ :phone: ✈️:airplane:
😨 :fearful: 🐗 :boar: 🔉 :sound: 🚲:bike:
😎 :sunglasses 🐑 :sheep: 📢 :loudspeaker: 🚕:taxi:
😭 :sob: 🐁 :mouse2: 📰 :newspaper: 🚌:bus:

详细请看参考文章或者文档 ,附上git支持emoji地址gitmoji

Donate
  • Copyright: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.

扫一扫,分享到微信

微信分享二维码
  • Copyrights © 2023-2025 IceBlin
  • Visitors: | Views:

thanks,but no~~

支付宝
微信
//引入