hexojs/hexo-fontawesome

Name: hexo-fontawesome

Owner: Hexo

Description: A utility function which helps to inline fontawesome SVG files.

Created: 2018-02-25 14:11:44.0

Updated: 2018-05-24 19:30:30.0

Pushed: 2018-05-24 19:30:53.0

Homepage: null

Size: 63

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

hexo-fontawesome

A plugin for static pages generator Hexo. A utility function which helps to inline fontawesome SVG files.

Installation
Easy way

Install this plugin and all free font-awesome styles:

i hexo-fontawesome --save
Advanced way

Install just a plugin:

i hexo-fontawesome --no-optional --save

Then you need to manually install all needed styles:

i @fortawesome/fontawesome-free-solid --save
i @fortawesome/fontawesome-free-regular --save
i @fortawesome/fontawesome-free-brands --save
Usage
In theme

This plugin adds a view helpers you can use in the theme to include inline SVG icons from the font-awesome collection.

fa_css()

Returns inline styles needed for the inline SVGs.

Example usage:

le>
- fa_css() %>
yle>
fa_inline(iconName, options)

Returns an SVG markup of the chosen icon.

Possible options:

fa_inline('twitter', {prefix: 'fab'}) %>
In post

This plugin adds a tag that you can use in the theme to include inline SVG icons from the font-awesome collection.

{% fa_css %}

Returns inline styles needed for the inline SVGs.

Example usage:


ost
Content
 Here

a_css %}
{% fa_inline iconName [prefix] %}

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:


ost
Content
a_inline twitter fab %}
 Here


a_css %}

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.