Hexo中使用emoji表情 | 南风

Hexo中使用emoji表情

注意: 这个方法我尝试了但是没有效果,还是没能显示emoji,但我还是发出来这个方法,也许你们可以
这个方法用的是npm后面我自己改用了yarn再重复本方法的操作就又可以了。。
其实安装完hexo-renderer-markdown-itmarkdown-it-emoji插件后就可以了,但是上面两个插件和hexo-renderer-markdown-it-plus不能同时安装!!

Hexo开启欢乐的emoji之旅:yellow_heart:
内容转载自:Hexo中使用emoji表情
将markdown转化为html的转化器叫做markdown渲染器。
在Hexo中默认的markdown渲染器是hexo-renderer-marked,这个渲染器是不支持emoji表情的。我们换一个支持emoji的引擎,再增加一个emoji插件即可。

安装

命令行如下:

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

Tips: 据说hexo-renderer-markdown-it的速度要比Hexo原装插件要快,而且功能更多

配置

完成插件安装后还需要修改Hexo站点配置文件_config.yml(不是主题配置文件哦)。

1
2
3
4
5
6
7
markdown:
plugins:
- markdown-it-footnote
- markdown-it-sup
- markdown-it-sub
- markdown-it-abbr
- markdown-it-emoji

更多配置参数可以看这个:点我进入

使用方法

输入对应的emoji编码就行了
例如:输入笑脸对应的emoji编码:smile:就可以得到:smile:。

emoji编码表

People
:smile::smile: :laughing::laughing: :blush::blush: :smiley::smiley:
:relaxed::relaxed: :smirk::smirk: :heart_eyes::heart_eyes: :kissing_heart::kissing_heart:
:kissing_closed_eyes::kissing_closed_eyes: :flushed::flushed: :relieved::relieved: :satisfied::satisfied:
:grin::grin: :wink::wink: :stuck_out_tongue_winking_eye::stuck_out_tongue_winking_eye: :stuck_out_tongue_closed_eyes::stuck_out_tongue_closed_eyes:
:grinning::grinning: :kissing::kissing: :kissing_smiling_eyes::kissing_smiling_eyes: :stuck_out_tongue::stuck_out_tongue:
:sleeping::sleeping: :worried::worried: :frowning::frowning: :anguished::anguished:
:open_mouth::open_mouth: :grimacing::grimacing: :confused::confused: :hushed::hushed:
:expressionless::expressionless: :unamused::unamused: :sweat_smile::sweat_smile: :sweat::sweat:
:disappointed_relieved::disappointed_relieved: :weary::weary: :pensive::pensive: :disappointed::disappointed:
:confounded::confounded: :fearful::fearful: :cold_sweat::cold_sweat: :persevere::persevere:
:cry::cry: :sob::sob: :joy::joy: :astonished::astonished:
:scream::scream: :tired_face::tired_face: :angry::angry: :rage::rage:
:triumph::triumph: :sleepy::sleepy: :yum::yum: :mask::mask:
:sunglasses::sunglasses: :dizzy_face::dizzy_face: :imp::imp: :smiling_imp::smiling_imp:
:neutral_face::neutral_face: :no_mouth::no_mouth: :innocent::innocent: :alien::alien:
:yellow_heart::yellow_heart: :blue_heart::blue_heart: :purple_heart::purple_heart: :heart::heart:
:green_heart::green_heart: :broken_heart::broken_heart: :heartbeat::heartbeat: :heartpulse::heartpulse:
:two_hearts::two_hearts: :revolving_hearts::revolving_hearts: :cupid::cupid: :sparkling_heart::sparkling_heart:
:sparkles::sparkles: :star::star: :star2::star2: :dizzy::dizzy:
:boom::boom: :collision::collision: :anger::anger: :exclamation::exclamation:
:question::question: :grey_exclamation::grey_exclamation: :grey_question::grey_question: :zzz::zzz:
:dash::dash: :sweat_drops::sweat_drops: :notes::notes: :musical_note::musical_note:
:fire::fire: :hankey::hankey: :poop::poop: :shit::shit:
:+1::+1: :thumbsup::thumbsup: :-1::-1: :thumbsdown::thumbsdown:
:ok_hand::ok_hand: :punch::punch: :facepunch::facepunch: :fist::fist:
:v::v: :wave::wave: :hand::hand: :raised_hand::raised_hand:
:open_hands::open_hands: :point_up::point_up: :point_down::point_down: :point_left::point_left:
:point_right::point_right: :raised_hands::raised_hands: :pray::pray: :point_up_2::point_up_2:
:clap::clap: :muscle::muscle: :metal::metal: :fu::fu:

未完待续…