# dwkns-eleventy-plugins

> A group of reusable plugins

Latest version **0.0.32** (published 2022-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install dwkns-eleventy-plugins
pnpm add dwkns-eleventy-plugins
yarn add dwkns-eleventy-plugins
bun add dwkns-eleventy-plugins
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.32 |
| Published | 2022-12-06 |
| First published | 2022-05-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | dwkns |
| Maintainers | dwkns |
| Keywords | eleventy, dwkns |

## Links

- npm: https://www.npmjs.com/package/dwkns-eleventy-plugins
- Repository: https://github.com/dwkns/dwkns-eleventy-plugins
- Homepage: https://github.com/dwkns/dwkns-eleventy-plugins#readme
- Issues: https://github.com/dwkns/dwkns-eleventy-plugins/issues
- npm.io page: https://npm.io/package/dwkns-eleventy-plugins

## Dependencies (4)

- [luxon](https://npm.io/package/luxon.md) ^2.4.0
- [cheerio](https://npm.io/package/cheerio.md) ^1.0.0-rc.10
- [escape-html](https://npm.io/package/escape-html.md) ^1.0.3
- [html-minifier](https://npm.io/package/html-minifier.md) ^4.0.0

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.0.32 (latest) — 2022-12-06
- 0.0.29 — 2022-12-06
- 0.0.22 — 2022-10-31
- 0.0.21 — 2022-10-31
- 0.0.19 — 2022-10-27
- 0.0.12 — 2022-08-31
- 0.0.10 — 2022-08-30
- 0.0.9 — 2022-08-30
- 0.0.8 — 2022-08-30
- 0.0.7 — 2022-08-30
- 0.0.6 — 2022-08-09
- 0.0.5 — 2022-08-09
- 0.0.4 — 2022-06-08
- 0.0.3 — 2022-05-18
- 0.0.2 — 2022-05-10
- … 1 more at https://npm.io/package/dwkns-eleventy-plugins/versions

## README

# dwkns-11ty-plugins
Set of plugins for 11ty. 
Probably not a lot of use for most people. 

## Installing

```bash
yarn add dwkns-eleventy-plugins
```



# htmlMinifer

Transform plugin which minifies HTML including inline CSS & JS on all HTML pages. If no options are passed in the following defaults are used. 

#### Usage

```js
// .eleventy.js
const { htmlMinifer } = require("dwkns-11ty-plugins");

module.exports = (eleventyConfig) => {
  // default options shown
  options = {
  	minify: true,
    minifyCSS: true,
    minifyJS: true,
	}
  eleventyConfig.addPlugin(htmlMinifer, options);
}
```

#### To pick up site settings

```js
options = { 
    minify: site[site.currentEnv].minify_html,  
};
```



# Console

Nunjucks shortcode that Pretty Prints out variables to HTML `<pre></pre>`  and to the console. Up to 8 levels of object are printed.

### Add to config. Usually `.eleventy.js`
```js
const { logToConsole } = require("dwkns-11ty-plugins");

module.exports = (eleventyConfig) => {
  // default options shown
  options = {
  	logToHtml: true,
    logToConsole: false,
    colorizeConsole: true,
    escapeHTML: true,
	}
  eleventyConfig.addPlugin(logToConsole);
}
```

### Usage
```
{{ console <value>, <title — optional> }}
```





# prependAnOrA

Nunjucks filter that prepends an `A` or `An` depending on the word supplied.

### Add to config. Usually `.eleventy.js`
```js
const { prependAnOrA } = require("dwkns-11ty-plugins");

module.exports = (eleventyConfig) => {
  ...
  eleventyConfig.addPlugin(prependAnOrA);
  ...
}
```

### Usage
```
{{ "book" | addAnOrA }} 
>> A book

{{ "orange" | addAnOrA }} 
>> An orange
```


## Readable Date
Nunjucks filter that Creates Readable Dates

### Add to config. Usually `.eleventy.js`
```js
const { readableDate } = require("dwkns-11ty-plugins");

module.exports = (eleventyConfig) => {
  ...
  eleventyConfig.addPlugin(readableDate, {
    format: ''dd LLL yyyy' // default
  });
  ...
}
```

### Usage
```
---
date: 2021-10-18
---

{{date | readableDate }}
>> 18 Oct 2021
```


## Inline SVG
Nunjucks async shortcode that inlines SVG's

Automatically removes height and width attributes.

### Add to config. Usually `.eleventy.js`
```js
const { inlineSVG } = require("dwkns-11ty-plugins");

module.exports = (eleventyConfig) => {
  ...
  eleventyConfig.addPlugin(inlineSVG);
  ...
}
```

### Usage
```
{% inlineSVG [filename], {options} %}

{% inlineSVG './src/images/logo.svg', { class: "w-auto h-16", alt: "Under2 logo", id: "under2Logo" } %}
```

### Options
| Options | Use                       | Default |
| ------- | ------------------------- | ------- |
| class   | Add `class=""` to the SVG |         |
| alt     | Add an Title to SVG       |         |
| id      | Add an `id=""` to SVG     |         |



### Publish with:
npm publish --access public
Needs a OTP from the Authy app

---
_Source: https://npm.io/package/dwkns-eleventy-plugins · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
