kenshodigital/kirby-minify

Minifies HTML and XML output for Kirby projects.

Maintainers

Package info

github.com/kenshodigital/kirby-minify

Type:kirby-plugin

pkg:composer/kenshodigital/kirby-minify

Statistics

Installs: 35

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-04-03 21:34 UTC

This package is auto-updated.

Last update: 2026-04-03 21:48:38 UTC


README

Minifies HTML and XML output for Kirby projects.

General

The plugin extends Kirby’s core template component and directly applies post-processing to template-based HTML and XML output. It removes comments and trims trailing whitespace from text nodes, using PHP’s native DOM parsers.

Further reading

Usage

Installation

composer require kenshodigital/kirby-minify ^1.0

Setup

The plugin works out-of-the-box, no further configuration required.

FAQ

Why extend the template component instead of using hooks?

Pages somehow always require a default HTML template and are therefore not well suited for other content types, such as XML sitemaps or other XML-only responses. Thus, the pages.render:after hook can’t be used to apply minification in such cases where you want to simply render a template directly instead.

The route:after hook, on the other hand, doesn’t always pass information about the content type of the rendered response, so it’s also not a good fit here.

Further reading