Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Adds support to minify HTML in DocPad
CoffeeScript HTML
tag: v2.3.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
test
.gitignore
.npmignore
.travis.yml
CONTRIBUTING.md
Cakefile
HISTORY.md
LICENSE.md
README.md
cyclic.js
package.json

README.md

HTML-Minifier Plugin for DocPad

Build Status NPM version Gittip button Flattr button

Allows minification of HTML in DocPad, using HTML-Minifier.

Convention: .html.anything

Install

$ docpad install htmlmin

Configure

Defaults

The default configuration for this plugin is the equivalant of adding the following html-minifier options to your DocPad configuration file:

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

Template Configuration

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

---
title: 'HTML-Minifier Demo'
htmlmin:
  removeComments: false
---
<html>
  <head>
    <title>HTML Minifier for DocPad</title>
  </head>
  <body>
    <!-- This HTML comment will not be removed. -->
  </body>
</html>

History

You can discover the history inside the History.md file

Contributing

You can discover the contributing instructions inside the Contributing.md file

License

Licensed under the incredibly permissive MIT License
Copyright © 2013 Rob Loach

Something went wrong with that request. Please try again.