kenshodigital/kirby-htmldoc

Minifies HTML5 output for Kirby projects.

2.0.0 2024-03-16 10:40 UTC

This package is auto-updated.

Last update: 2024-12-17 13:57:02 UTC


README

Minifies HTML5 output for Kirby projects.

General

Integrates Hexydec’s excellent HTMLDoc library into Kirby projects to minify HTML5 output.

Installation

composer require kenshodigital/kirby-htmldoc ^2.0

Usage

Basically works out of the box without any additional configuration.

Configuration

However, applicable content types as well as the library’s default configuration can be easily modified in your site’s config.php.

<?php declare(strict_types=1); 

return [
    'kensho.htmldoc' => [
        'contentTypes' = [
            'htm',
            'html',                    
        ],
        'config' => [
            'minify' => [
                'quotes' => false,
                'urls'   => [
                    'relative' => false,
                    'parent'   => false,
                ],
                ...
            ],
        ],
    ],
];

Defaults

Applicable content types are set to htm and html by default. For the library, only the settings for quotes and relative URLs deviate from the library’s defaults and are set to false in this plugin.