A plugin for static pages generator Hexo. A utility function which helps to inline fontawesome SVG files.
- NodeJS at least 6.x
Install this plugin and all free font-awesome styles:
npm install hexo-fontawesome-icons --save
This plugin adds a view helpers you can use in the theme to include inline SVG icons from the font-awesome collection.
Returns inline styles needed for the inline SVGs.
Example usage:
<style>
<%- fa_css() %>
</style>
in EJS template or
<style>
{{ fa_css() }}
</style>
in NunJucks tempalte
Returns an SVG markup of the chosen icon.
Possible options:
prefix
- the style prefix,fab
for brands,fas
for solid etc. Defaults tofas
<%- fa_inline('twitter', { prefix: 'fab' }) %> // in EJS template
{{ fa_inline('twitter', { prefix: 'fab' }) }} // in NunJucks template
This plugin adds a tag that you can use in the theme to include inline SVG icons from the font-awesome collection.
Returns inline styles needed for the inline SVGs.
Example usage:
# My
## Post
### Content
#### Here
{% fa_css %}
Returns an SVG markup of the chosen icon.
prefix
is the style prefix, fab
for brands, fas
for solid etc. Defaults to fas
Example usage:
# My
## Post
### Content
{% fa_inline twitter fab %}
#### Here
{% fa_css %}
Special thanks to hexojs for creating the original hexo-fontawesome on which this project is based.