All Projects → crimx → Hexo Filter Github Emojis

crimx / Hexo Filter Github Emojis

Licence: mit
github emojis for hexo! 🎉

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Hexo Filter Github Emojis

Hexo Theme Clean Blog
Hexo implementation of Clean Blog http://blackrockdigital.github.io/startbootstrap-clean-blog/index.html
Stars: ✭ 362 (+409.86%)
Mutual labels:  blog, hexo
Hexo Theme Material
Material Design theme for hexo.
Stars: ✭ 4,028 (+5573.24%)
Mutual labels:  blog, hexo
Hexo Theme Claudia
📌 Concisely designed & easy to config, match device dark mode, 90+ Lighthouse scoring
Stars: ✭ 379 (+433.8%)
Mutual labels:  blog, hexo
Hexo Theme Fluid
🌊 一款 Material Design 风格的 Hexo 主题 / An elegant Material-Design theme for Hexo
Stars: ✭ 3,700 (+5111.27%)
Mutual labels:  blog, hexo
Hexo Theme Nexmoe
🔥 一个比较特别的 Hexo 主题
Stars: ✭ 789 (+1011.27%)
Mutual labels:  blog, hexo
Hexo Theme Daily
A simple theme for Hexo
Stars: ✭ 246 (+246.48%)
Mutual labels:  blog, hexo
Blog
🎯 个人博客
Stars: ✭ 394 (+454.93%)
Mutual labels:  blog, hexo
Hexo Theme Cactus
🌵 A responsive, clean and simple theme for Hexo.
Stars: ✭ 2,139 (+2912.68%)
Mutual labels:  blog, hexo
Hexo Theme Anisina
🎨 A simple responsive , support qiniu image cdn theme for hexo https://haojen.github.io/
Stars: ✭ 746 (+950.7%)
Mutual labels:  blog, hexo
Opensource Socialnetwork
Open Source Social Network (OSSN) is a social networking software written in PHP. It allows you to make a social networking website and helps your members build social relationships, with people who share similar professional or personal interests. It is available in 16 international languages.
Stars: ✭ 710 (+900%)
Mutual labels:  blog, emoji
Free Gophers Pack
✨ This pack of 100+ gopher pictures and elements will help you to build own design of almost anything related to Go Programming Language: presentations, posts in blogs or social media, courses, videos and many, many more.
Stars: ✭ 2,343 (+3200%)
Mutual labels:  blog, emoji
Hexo Theme Diaspora
Hexo theme, Blog theme, Clean, Responsive theme
Stars: ✭ 986 (+1288.73%)
Mutual labels:  blog, hexo
Hexo Theme Shana
what's a cool hexo theme!
Stars: ✭ 166 (+133.8%)
Mutual labels:  blog, hexo
Easy Hexo
🤘 Build your own website with Hexo, the easy way. | 轻松使用 Hexo 建站。
Stars: ✭ 314 (+342.25%)
Mutual labels:  blog, hexo
Hexo Theme Book
A simple, elegant, book-like hexo theme with some useful features.
Stars: ✭ 166 (+133.8%)
Mutual labels:  blog, hexo
Hexo Theme Aircloud
A concise hexo theme
Stars: ✭ 394 (+454.93%)
Mutual labels:  blog, hexo
Hexo Theme Amazing
Demo: https://removeif.github.io/removeif-demo hexo-theme
Stars: ✭ 154 (+116.9%)
Mutual labels:  blog, hexo
Lruihao.github.io
A Hexo-Next.Pisces Blog modified by LRH.
Stars: ✭ 162 (+128.17%)
Mutual labels:  blog, hexo
Hexo Theme Inside
🌈 SPA, Flat and clean theme for Hexo.
Stars: ✭ 480 (+576.06%)
Mutual labels:  blog, hexo
0x5e.github.io
A peosonal blog
Stars: ✭ 5 (-92.96%)
Mutual labels:  blog, hexo

hexo-filter-github-emojis

Npm Version Npm Downloads Month Npm Downloads Total License

A Hexo plugin that adds emoji support, using Github Emojis API.

Check out the Emoji Cheat Sheet for all the emojis it supports.

Installation

$ npm install hexo-filter-github-emojis --save

Options

You can configure this plugin in _config.yml. Default options:

githubEmojis:
  enable: true
  className: github-emoji
  inject: true
  styles:
  customEmojis:
  • enable boolean=true - Enable :: emoji parsing. If off the tag and helper still work.

  • className string="github-emoji" - Emoji class name.
    For example ✨ the filter will generate something like this:

    <span class="github-emoji"><span>&#x2728;</span><img src="https://assets-cdn.github.com/images/icons/emoji/unicode/2728.png?v8"></span>
    
  • inject boolean=true - Inject emoji styles and fallback script.
    If true, the filter will inject a <style> to the html.
    If false, the filter will not inject any style. If you can modify source style files you may turn this off and add them yourself.

    Below are the injected styles. The class name changes according to option.

    .github-emoji {
      position: relative;
      display: inline-block;
      width: 1.2em;
      min-height: 1.2em;
      overflow: hidden;
      vertical-align: top;
      color: transparent;
    }
    
    .github-emoji > span {
      position: relative;
      z-index: 10;
    }
    
    .github-emoji img,
    .github-emoji .fancybox {
      margin: 0 !important;
      padding: 0 !important;
      border: none !important;
      outline: none !important;
      text-decoration: none !important;
      user-select: none !important;
      cursor: auto !important;
    }
    
    .github-emoji img {
      height: 1.2em !important;
      width: 1.2em !important;
      position: absolute !important;
      left: 50% !important;
      top: 50% !important;
      transform: translate(-50%, -50%) !important;
      user-select: none !important;
      cursor: auto !important;
    }
    
    .github-emoji-fallback {
      color: inherit;
    }
    
    .github-emoji-fallback img {
      opacity: 0 !important;
    }
    
  • styles object={} - inline styles. For example:

    githubEmojis:
      styles:
        font-size: 2em
        font-weight: bold
    

    outputs:

    <span class="github-emoji" style="font-size:2em;font-weight:bold" ...>
    
  • customEmojis object={} - You can specify your own list. An object or JSON string is valid. The filter will first check the customEmojis then fallback to the Github Emojis list.

    For example:

    githubEmojis:
      customEmojis:
        arrow_left: https://path/to/arrow_left.png
        arrow_right: https://path/to/arrow_right.png
    

    If you need to add code points that are not in the Github list, you can do this:

    githubEmojis:
      customEmojis:
        man_juggling:
          src: https://path/to/man_juggling.png
          codepoints: ["1f939", "2642"]
        arrow_right: https://path/to/arrow_right.png
    

Tag

If you do not like the ::-style keywords, you can always use tags:

{% github_emoji sparkles %}

Add no-emoji: true to front-matter to stop replacing :::

---
title: Hello World
no-emoji: true
---

🎉 as it is.

{% github_emoji tada %} still works.

Helper

You can also render a GitHub emoji from a template using the github_emoji helper:

<h1><%- github_emoji('octocat') %></h1>

Fancybox

If you are using theme that enables fancybox(e.g. the default landscape theme) it is recommended to skip the github emoji imgs.

Edit themes/landscape/source/script.js

   // Caption
   $('.article-entry').each(function(i){
     $(this).find('img').each(function(){
       if ($(this).parent().hasClass('fancybox')) return;
+      if ($(this).parent().hasClass('github-emoji')) return;
 
       var alt = this.alt;
 
       if (alt) $(this).after('<span class="caption">' + alt + '</span>');
 
       $(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
     });
 
     $(this).find('.fancybox').each(function(){
       $(this).attr('rel', 'article' + i);
     });
   });
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].