An eleventy plugin containing shortcodes and other helpers to generate markup necessary to connect your website to the IndieWeb.
- Eleventy v1.0.0 or higher
- h-card shortcode to generate markup containing h-cards in your template
- globally accessible 11ty data to retrieve specific h-card properties
- shortcodes to wrap h-entry properties throughout the markup in your posts page
npm install eleventy-plugin-indieweb
Then, include it in your .eleventy.js
config file:
const eleventyPluginIndieWeb = require("eleventy-plugin-indieweb");
module.exports = (eleventyConfig) => {
eleventyConfig.addPlugin(eleventyPluginIndieWeb);
};
Option | Type | Default | Usage |
---|---|---|---|
key | string | "indieWeb" | 11ty data key to access plugin-related data |
hCard | object | {} | h-card properties to populate your h-card with |
You can populate hCard data in the options object. The property keys are equal to those displayed in the h-card specification, but without the prefix and in pascal case.
For example: name
maps to p-name
and extendedAddress
maps to p-extended-address
.
There are some properties that are not yet implemented. Those are:
p-geo
u-impp
u-sound
Returns the h-card markup based on the values supplied into your plugin config. You can optionally pass an overrides object to override any of these values.
In the hCard options, you can pass:
Option | Type | Default | Usage |
---|---|---|---|
class | string | additional classes to render the parent element with |
Thanks to 5t3ph for the plugin template.