#+TITLE: hexo-article-emoji

This pulgin is for hexo, give your articles emoji support.

* README in English
** What is hexo-article-emoji ?
This is for the hexo static blog system to write a plugin, the function is to add emoji expression to your article support.

 This plugin is through the analysis of the final HTML generated by the hexo renderer,
 from the <p> tag to replace the emoji syntax corresponding to the realization of the picture.
 So it does not only support markdown, in fact I use org-mode to write blog it is also supported.

** How to install?
First, run in your blog directory:
#+BEGIN_SRC bash
npm install https://github.com/frapples/hexo-article-emoji --save
#+END_SRC

After that, you need to copy the emoji picture resources to your source folder. It is =source/images/emoji= folder.
Run in the blog directory: 
#+BEGIN_SRC bash
hexo article-emoji install
#+END_SRC

In fact emoji pictures have two versions, light and full version.
 The default will only copy the light version, if you want to copy the full version:
#+BEGIN_SRC bash
hexo article-emoji install full
#+END_SRC

Remove the picture installed by above command, in fact, is to delete the =source/images/emoji= folder:
#+BEGIN_SRC bash
hexo article-emoji remove
#+END_SRC

**  How to configure?
You need to edit hexo configuration file =_config.yml=, find the option to change to =true=:
#+BEGIN_SRC yml
post_asset_folder: true
#+END_SRC 

If you need to use the full version of emoji expression, you need to join in =_config.yml=
#+BEGIN_SRC yml
article_emoji:
  full: true
#+END_SRC

** How to use?
This link contains a table, lists the emoji syntax and expression of the relationship:
http://www.webpagefx.com/tools/emoji-cheat-sheet/

For example, you write:
#+BEGIN_EXAMPLE
I fell good! :simple_smile:
#+END_EXAMPLE
=:simple_smile:= will be parsed into the corresponding emoji expression image, which is displayed.

Now, try to add emoji expression to your blog, then:
#+BEGIN_SRC bash
hexo g
#+END_SRC
Enjoy it!

** thanks

This plugin refers to the following two plug-in resources:
- https://github.com/sergiolepore/hexo-tag-emojis
- https://github.com/markdown-it/markdown-it-emoji
  
Thanks to them.

* 中文文档
** hexo-article-emoji 是什么？
这是为 hexo 静态博客系统写的一个插件，功能是给你的文章添加 emoji 表情支持。

这个插件是通过解析文章最终生成的 HTML，从<p>标签中把 emoji 语法替换成对应的图片实现的。
所以它不仅支持 markdown，实际上我使用 org-mode 写博客它也是支持的。

** 如何安装？
首先，在你的博客目录下运行：
#+BEGIN_SRC bash
npm install https://github.com/frapples/hexo-article-emoji --save
#+END_SRC

如果你和我一样，是大陆用户，不想卡成狗的话，你最好使用阿里的镜像源：
#+BEGIN_SRC bash
npm install https://github.com/frapples/hexo-article-emoji --save --registry=https://registry.npm.taobao.org
#+END_SRC

之后，你需要把 emoji 的图片资源复制到你的 source 文件夹去，默认会复制到你的 source/images/emoji 文件夹。
在博客目录执行：
#+BEGIN_SRC bash
hexo article-emoji install
#+END_SRC
实际上 emoji 图片有两个版本，精简版和完整版。默认只会复制精简版，如果你想复制完整版的话：
#+BEGIN_SRC bash
hexo article-emoji install full
#+END_SRC
移除上面命令安装的图片，其实也就是删除 source/images/emoji 文件夹：
#+BEGIN_SRC bash
hexo article-emoji remove
#+END_SRC

** 如何配置？
你需要编辑 hexo 的配置文件 =_config.yml= ， 找到一下选项，改为 =true= ：
#+BEGIN_SRC yml
post_asset_folder: true
#+END_SRC 

假如你需要使用完整版的 emoji 表情，你需要在 =_config.yml= 加入：
#+BEGIN_SRC yml
article_emoji:
  full: true
#+END_SRC 

** 如何使用？
这个链接附上了 emoji 的语法和表情的对照表：
http://www.webpagefx.com/tools/emoji-cheat-sheet/
比如说，你输入：
#+BEGIN_EXAMPLE
I fell good! :simple_smile:
#+END_EXAMPLE
=:simple_smile:= 会被解析成对应的 emoji 表情图片，从而显示出来。

现在，试试在你的博客里添加 emoji 表情，然后：
#+BEGIN_SRC bash
hexo g
#+END_SRC
看看吧！

** 感谢
本插件参考了以下两个插件的资源：
- https://github.com/sergiolepore/hexo-tag-emojis
- https://github.com/markdown-it/markdown-it-emoji
特此感谢。
