No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-30 16:56:05 +01:00
src composer.json update 2026-10-30 16:56:05 +01:00
.gitignore Initial commit 2026-10-30 16:32:31 +01:00
composer.json composer.json update 2026-10-30 16:56:05 +01:00
index.php Initial commit 2026-10-30 16:32:31 +01:00
LICENSE Initial commit 2026-10-30 16:32:31 +01:00
README.md Initial commit 2026-10-30 16:32:31 +01:00

Kirby Minify HTML

A modified version of afbora/kirby-minify-html, a Kirby CMS plugin that minifies HTML output using voku/HtmlMin.

This fork retains the original plugin's functionality while adding a few improvements and fixes for URL optimization and HTML output.

Features

All original features from afbora/kirby-minify-html are preserved, along with the following modifications.

URL optimization

  • *Preserve SEO URLs: Canonical and alternate links ( and ) keep their absolute URLs when doMakeSameDomainsLinksRelative() is enabled.
  • Fix srcset optimization: Ensures that all URLs in srcset attributes are converted to relative URLs, not just the first one.

Installation

Install the plugin using Composer:

composer require sylvainallignol/kirby-minify-html

Configuration

The plugin retains the original configuration options.

Example:

return [
    'sylvainallignol.minify-html' => [
        'enabled' => true,
        'ignore' => [
            'sitemap',
            'rss'
        ],
        'options' => [
            'doOptimizeViaHtmlDomParser'     => true,
            'doRemoveSpacesBetweenTags'      => false,
            'doMakeSameDomainsLinksRelative' => ['example.com']
        ]
    ]
];

Refer to the voku/HtmlMin documentation for the complete list of available optimization options.

Original project

This project is based on:

afbora/kirby-minify-html

The original plugin's functionality and configuration structure have been retained.

License

MIT