A plugin for static pages generator Hexo. A utility function which helps to inline fontawesome SVG files.
- NodeJS at least 16.x
Install this plugin and all free font-awesome styles:
npm install hexo-fontawesome --save
Install just a plugin:
npm install hexo-fontawesome --no-optional --save
Then you need to manually install all needed styles:
npm install @fortawesome/free-solid-svg-icons --save
npm install @fortawesome/free-regular-svg-icons --save
npm install @fortawesome/free-brands-svg-icons --save
Font Awesome change package names in 5.1 https://github.com/FortAwesome/Font-Awesome/blob/master/UPGRADING.md#50x-to-510
It's significant change enough for hexo-fontawesome
to bump major version here.
- Uninstall icon packages if you did it manually:
npm uninstall @fortawesome/fontawesome-free-solid
npm uninstall @fortawesome/fontawesome-free-regular
npm uninstall @fortawesome/fontawesome-free-brands
- Install their 5.1+ alternatives
npm install @fortawesome/free-solid-svg-icons --save
npm install @fortawesome/free-regular-svg-icons --save
npm install @fortawesome/free-brands-svg-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>
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'}) %>
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 %}