Skip to content

bradleyburgess/eleventy-plugin-img-figcaptions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eleventy-plugin-img-figcaptions

Table Of Contents

Overview

This Eleventy plugin is a wrapper around @bradleyburgess/img-figcaptions to add semantic HTML captions using plain-text "Caption: " blocks.

Installation

NPM:

npm i -D @bradleyburgess/eleventy-plugin-img-figcaptions

Yarn:

yarn add -D @bradleyburgess/eleventy-plugin-img-figcaptions

Usage

Add the plugin to your Eleventy config. For options for the transformer, see the @bradleyburgess/img-figcaptions readme.

// .eleventy.js or your Eleventy config
const imgFigcaptions = require("@bradleyburgess/img-figcaptions");

module.exports = function (eleventyConfig) {
  eleventyConfig.addPlugin(imgFigcaptions);
  // ... rest of your config
};

You can pass options to img-figcaptions:

const options = {
  imgFigcaptionsOptions: {
    removeTitle: false,
    replaceEmptyParagraph: true,
  },
};

module.exports = function (eleventyConfig) {
  eleventyConfig.addPlugin(imgFigcaptions, options);
  // ... rest of your config
};

Roadmap

There is currently no customization to the Eleventy side of the plugin. But some features that might be added in the future:

  • Allow exclusion of input paths
  • Allow exclusion of output paths

About

An Eleventy HTML transform plugin to easily add semantic captions to images

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published