afbora/kirby-minify-html

Enable minify HTML output for Kirby 3 and 4.

2.1.0 2023-12-13 15:46 UTC

This package is auto-updated.

Last update: 2024-11-13 17:48:40 UTC


README

Enable minify HTML output for Kirby 3 and 4.

Installation

Installation with composer

composer require afbora/kirby-minify-html

Add as git submodule

git submodule add https://github.com/afbora/kirby-minify-html.git site/plugins/kirby-minify-html

Options

The default values of the package are:

Available Minify Options

All the values can be updated in the config.php file.

You can get detailed information from HtmlMin library: https://github.com/voku/HtmlMin#options

Protected HTML

Inline css, inline js, conditional comments are still protected, no matter what settings you use.

Usage

return [
    'afbora.kirby-minify-html.enabled' => true,
    'afbora.kirby-minify-html.options' => [
        'doOptimizeViaHtmlDomParser'     => true,
        'doRemoveSpacesBetweenTags'      => false,
        'doMakeSameDomainsLinksRelative' => ['example.com']
    ],
];