# docpad-plugin-htmlmin

> Adds support to minify HTML in DocPad.

Latest version **2.4.3** (published 2015-02-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install docpad-plugin-htmlmin
pnpm add docpad-plugin-htmlmin
yarn add docpad-plugin-htmlmin
bun add docpad-plugin-htmlmin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.3 |
| Published | 2015-02-19 |
| First published | 2013-10-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.4 |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Rob Loach |
| Maintainers | robloach |
| Keywords | docpad, docpad-plugin, html-minifier |

## Links

- npm: https://www.npmjs.com/package/docpad-plugin-htmlmin
- Repository: https://github.com/RobLoach/docpad-plugin-htmlmin
- Homepage: http://github.com/robloach/docpad-plugin-htmlmin
- Issues: http://github.com/robloach/docpad-plugin-htmlmin/issues
- npm.io page: https://npm.io/package/docpad-plugin-htmlmin

## Dependencies (1)

- [html-minifier](https://npm.io/package/html-minifier.md) ^0.7.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 2.4.3 (latest) — 2015-02-19
- 2.4.2 — 2015-02-19
- 2.4.1 — 2015-02-19
- 2.4.0 — 2014-02-19
- 2.3.2 — 2014-01-23
- 2.3.1 — 2013-12-23
- 2.3.0 — 2013-12-13
- 2.2.0 — 2013-12-06
- 2.1.2 — 2013-11-09
- 2.1.1 — 2013-10-27
- 2.1.0 — 2013-10-18
- 2.0.1 — 2013-10-14
- 2.0.0 — 2013-10-14
- 0.0.1 — 2013-10-14

## README

# [HTML-Minifier](http://github.com/kangax/html-minifier) Plugin for [DocPad](http://docpad.org)

<!-- BADGES/ -->

[![Build Status](https://img.shields.io/travis/RobLoach/docpad-plugin-htmlmin/master.svg)](http://travis-ci.org/RobLoach/docpad-plugin-htmlmin "Check this project's build status on TravisCI")
[![NPM version](https://img.shields.io/npm/v/docpad-plugin-htmlmin.svg)](https://npmjs.org/package/docpad-plugin-htmlmin "View this project on NPM")
[![NPM downloads](https://img.shields.io/npm/dm/docpad-plugin-htmlmin.svg)](https://npmjs.org/package/docpad-plugin-htmlmin "View this project on NPM")
[![Dependency Status](https://img.shields.io/david/RobLoach/docpad-plugin-htmlmin.svg)](https://david-dm.org/RobLoach/docpad-plugin-htmlmin)
[![Dev Dependency Status](https://img.shields.io/david/dev/RobLoach/docpad-plugin-htmlmin.svg)](https://david-dm.org/RobLoach/docpad-plugin-htmlmin#info=devDependencies)<br/>


<!-- /BADGES -->


Allows minification of HTML in [DocPad](https://docpad.org), using
[HTML-Minifier](http://github.com/kangax/html-minifier).

Convention:  `.html.anything`


<!-- INSTALL/ -->

## Install

``` bash
docpad install htmlmin
```

<!-- /INSTALL -->


## Usage

Create an HTML file with the `htmlmin` option:

``` html
---
htmlmin: true
---
<h1>HTML-Minifier Demo</h1>
<p>This file will be minified.</p>

<!-- This HTML comment will be removed when minified. -->
```


## Configure

### Defaults

The default configuration for this plugin is the equivalant of adding the following [html-minifier options](http://perfectionkills.com/experimenting-with-html-minifier/#options) to your [DocPad configuration file](http://docpad.org/docs/config):

``` coffee
  plugins:
    htmlmin:
      removeComments: true
      removeCommentsFromCDATA: false
      removeCDATASectionsFromCDATA: false
      collapseWhitespace: true
      collapseBooleanAttributes: false
      removeAttributeQuotes: false
      removeRedundantAttributes: false
      useShortDoctype: false
      removeEmptyAttributes: false
      removeOptionalTags: false
      removeEmptyElements: false

      # Disabled on development environments.
      environments:
        development:
          enabled: false
```

### Template Configuration

It is possible to override the default configuration on a per-template basis:

``` html
---
title: 'HTML-Minifier Demo'
htmlmin:
  removeComments: false
---
<h1>HTML-Minifier Demo</h1>
<p>This file will be minified.</p>

<!-- This HTML comment will not removed when minified. -->
```


<!-- HISTORY/ -->

## History
[Discover the change history by heading on over to the `HISTORY.md` file.](https://github.com/RobLoach/docpad-plugin-htmlmin/blob/master/HISTORY.md#files)

<!-- /HISTORY -->


<!-- CONTRIBUTE/ -->

## Contribute

[Discover how you can contribute by heading on over to the `CONTRIBUTING.md` file.](https://github.com/RobLoach/docpad-plugin-htmlmin/blob/master/CONTRIBUTING.md#files)

<!-- /CONTRIBUTE -->


<!-- BACKERS/ -->

## Backers

### Maintainers

These amazing people are maintaining this project:

- Rob Loach (http://github.com/RobLoach)

### Sponsors

No sponsors yet! Will you be the first?



### Contributors

These amazing people have contributed code to this project:

- [Benjamin Lupton](https://github.com/balupton) <b@lupton.cc> — [view contributions](https://github.com/RobLoach/docpad-plugin-htmlmin/commits?author=balupton)
- [paleite](https://github.com/paleite) — [view contributions](https://github.com/RobLoach/docpad-plugin-htmlmin/commits?author=paleite)
- [Rob Loach](http://github.com/RobLoach) — [view contributions](https://github.com/RobLoach/docpad-plugin-htmlmin/commits?author=RobLoach)

[Become a contributor!](https://github.com/RobLoach/docpad-plugin-htmlmin/blob/master/CONTRIBUTING.md#files)

<!-- /BACKERS -->


<!-- LICENSE/ -->

## License

Licensed under the incredibly [permissive](http://en.wikipedia.org/wiki/Permissive_free_software_licence) [MIT license](http://creativecommons.org/licenses/MIT/)

Copyright &copy; Rob Loach (http://github.com/RobLoach)

<!-- /LICENSE -->

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