Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashur/eleventy-plugin-emoji-shortcodes
Transform emoji shortcodes to accessible elements
https://github.com/ashur/eleventy-plugin-emoji-shortcodes
eleventy eleventy-plugin emoji
Last synced: 4 days ago
JSON representation
Transform emoji shortcodes to accessible elements
- Host: GitHub
- URL: https://github.com/ashur/eleventy-plugin-emoji-shortcodes
- Owner: ashur
- Created: 2022-04-07T03:49:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-30T20:44:56.000Z (over 2 years ago)
- Last Synced: 2024-12-16T21:11:59.511Z (9 days ago)
- Topics: eleventy, eleventy-plugin, emoji
- Language: JavaScript
- Homepage:
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# eleventy-plugin-emoji-shortcodes
Transform [emoji shortcodes](https://emojipedia.org/shortcodes/) to accessible elements.
For example, the following Markdown:
```markdown
who called them “dad jokes” instead of “popcorn”? :drum:
```would be rendered as:
```html
who called them “dad jokes” instead of “popcorn”? 🥁
```Transformation happens after templates are rendered to HTML, so all Eleventy template syntaxes are supported.
> See the [gemoji project](https://github.com/wooorm/gemoji/blob/7.1.0/index.js#L14570) for details on supported shortcode strings.
## Usage
To install this plugin, run the following command at the root of your Eleventy project:
```shell
npm install --save @aaashur/eleventy-plugin-emoji-shortcodes
```Next, include the following in your [Eleventy config file](https://www.11ty.dev/docs/config/):
```javascript
const emojiShortcodes = require("@aaashur/eleventy-plugin-emoji-shortcodes");module.exports = (eleventyConfig) => {
eleventyConfig.addPlugin(emojiShortcodes);
};
```## Plugin Options
| Option | Type |
| :-- | :-- |
| `class` | string |To set a class name (or names), set the `class` option when registering the plugin:
```javascript
eleventyConfig.addPlugin(emojiShortcodes, { class: 'emoji' });
``````
:popcorn:
``````html
🍿
```