afbora/kirby-minify-html

Enable minify HTML output for Kirby

Installs: 11 701

Dependents: 1

Suggesters: 0

Security: 0

Stars: 36

Watchers: 2

Forks: 3

Open Issues: 1

Type:kirby-plugin

2.2.0 2025-02-15 22:11 UTC

This package is auto-updated.

Last update: 2025-02-15 22:15:05 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,
        'ignore' => [
            'sitemap',
            'rss'
        ],
        'options' => [
            'doOptimizeViaHtmlDomParser'     => true,
            'doRemoveSpacesBetweenTags'      => false,
            'doMakeSameDomainsLinksRelative' => ['example.com']
        ]
    ]
];