1.0.2 • Published 2 years ago

@aaashur/eleventy-plugin-emoji-shortcodes v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

eleventy-plugin-emoji-shortcodes

Transform emoji shortcodes to accessible elements.

For example, the following Markdown:

who called them “dad jokes” instead of “popcorn”? :drum:

would be rendered as:

<p>who called them “dad jokes” instead of “popcorn”? <span aria-label="drum" role="img">🥁</span></p>

Transformation happens after templates are rendered to HTML, so all Eleventy template syntaxes are supported.

See the gemoji project for details on supported shortcode strings.

Usage

To install this plugin, run the following command at the root of your Eleventy project:

npm install --save @aaashur/eleventy-plugin-emoji-shortcodes

Next, include the following in your Eleventy config file:

const emojiShortcodes = require("@aaashur/eleventy-plugin-emoji-shortcodes");

module.exports = (eleventyConfig) => {
    eleventyConfig.addPlugin(emojiShortcodes);
};

Plugin Options

OptionType
classstring

To set a class name (or names), set the class option when registering the plugin:

eleventyConfig.addPlugin(emojiShortcodes, { class: 'emoji' });
:popcorn:
<span aria-label="popcorn" role="img" class="emoji">🍿</span>
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago