https://github.com/joshuacc/eleventy-plugin-gravatar
An Eleventy Plugin for Gravatar avatars
https://github.com/joshuacc/eleventy-plugin-gravatar
Last synced: 2 months ago
JSON representation
An Eleventy Plugin for Gravatar avatars
- Host: GitHub
- URL: https://github.com/joshuacc/eleventy-plugin-gravatar
- Owner: joshuacc
- Created: 2020-10-07T15:43:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-08T20:01:26.000Z (over 4 years ago)
- Last Synced: 2025-03-02T00:49:00.308Z (3 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Eleventy Plugin for Gravatar
This plugin adds a `gravatarUrl` filter which allows you to easily convert an email address into the associated Gravatar image URL. It also allows you to specify what size image you would like to use.
## Installing the Plugin
In your Eleventy project: `npm install --save-dev eleventy-plugin-gravatar`
In your `.eleventy.js` configuration file, import the plugin, and pass it to Eleventy's `addPlugin` method:
```js
const gravatarPlugin = require('eleventy-plugin-gravatar');module.exports = (eleventyConfig) => {
eleventyConfig.addPlugin(gravatarPlugin);
};
```## Usage Examples
Examples for Liquid and Nunjucks templates are provided below. For other templating languages, consult the documentation for Eleventy or your template language.
### Liquid
```liquid
![]()
```### Nunjucks
```nunjucks
![]()
```