操作方法基于hexo插件hexo-tag-emojis的github页面介绍。

安装hexo插件

在hexo的根目录运行如下命令

npm install hexo-tag-emojis --save

在hexo根目录的配置文件_config.yml启用插件,在plugins:项目添加

hexo-tag-emojis

emoji图片资源部署(本地方式,即图片会真实存在于hexo文件夹内)

1.打开hexo根目录的配置文件_config.yml,粘贴如下行

hexo-tag-emojis plugin configuration
emojis: image_dir: images/emojis

2.添加emoji图片资源,在hexo根目录运行命令

 hexo emojis install

反之若要删除emoji,运行

hexo emojis remove

ps.另有CDN部署方式,需要的话请去github查看方法。

使用方法

Method 1 - Inline emoji

{% emoji [emojiNameWithoutColons] [emojiSize] [class1,class2,class3] %}

Example:

{% emoji heart 32 custom_class1,custom_class2 %}

Heads up! emojiSize defaults to 20. Classes must be comma-separated and without spaces between them. emoji and nofancybox classes are added automatically.

Method 2 - Emoji block

This is the best choice if you want to process a whole paragraph.

{% emoji-block [emojiSize] [class1,class2,class3] %}

​ Lorem ipsum dolor sit amet :emojiName:

​ consectetur adipisicing elit :anotherEmojiName:

{% endemoji-block %}

Example:

{% emoji-block %}

​ Lorem ipsum dolor sit amet :smiley:

​ consectetur adipisicing elit :boom:

{% endemoji-block %}