Neolithic Psychedelic Mushrooms
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    docpad-plugin-htmlminpublic

    HTML-Minifier Plugin for DocPad

    Build Status NPM version NPM downloads Dependency Status Dev Dependency Status

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

    Convention: .html.anything

    Install

    docpad install htmlmin

    Usage

    Create an HTML file with the htmlmin option:

    ---
    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 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
     
          # Disabled on development environments. 
          environments:
            development:
              enabled: false

    Template Configuration

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

    ---
    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

    Discover the change history by heading on over to the HISTORY.md file.

    Contribute

    Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

    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:

    Become a contributor!

    License

    Licensed under the incredibly permissive MIT license

    Copyright © Rob Loach (http://github.com/RobLoach)

    install

    npm i docpad-plugin-htmlmin

    Downloadsweekly downloads

    34

    version

    2.4.3

    license

    MIT

    homepage

    github.com

    repository

    githubgithub

    last publish

    collaborators

    • avatar