@jamshop/eleventy-plugin-string-filters

1.0.0 • Public • Published

Eleventy Plugin - String filters

A bunch of useful string filters for 11ty.

Install:

npm install @jamshop/eleventy-plugin-string-filters

Usage

In your main config .eleventy.js:

const pluginStringFilters = require("@jamshop/eleventy-plugin-string-filters");

module.exports = (eleventyConfig) => {
  eleventyConfig.addPlugin(pluginStringFilters);
  // and the rest of your config
};

Or import an individual filter:

const { plural } = require("@jamshop/eleventy-plugin-string-filters");

module.exports = (eleventyConfig) => {
  eleventyConfig.addFilter("plural", unique);
  // and the rest of your config
};

Filters include:

  • camelize
  • deslugify
  • embedUrl
  • excerpt
  • isAlpha
  • isAlphanumeric
  • isEmail
  • isEmbeddable
  • isNumeric
  • isUrl
  • lcfirst
  • singular
  • singular
  • plural
  • minify
  • readTime
  • swapCase
  • title
  • ucfirst
  • underscored
  • wordCount

Readme

Keywords

none

Package Sidebar

Install

npm i @jamshop/eleventy-plugin-string-filters

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

6.62 kB

Total Files

3

Last publish

Collaborators

  • madebymike