afbora / kirby-minify-html
Enable minify HTML output for Kirby 3 and 4.
Fund package maintenance!
a.paddle.com/v2/click/1129/52467?link=1170
Installs: 10 645
Dependents: 1
Suggesters: 0
Security: 0
Stars: 36
Watchers: 2
Forks: 3
Open Issues: 1
Type:kirby-plugin
Requires
- php: ^8.0
- getkirby/composer-installer: ^1.2
- voku/html-min: ^4.5
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'] ], ];