kenshodigital/kirby-minify
最新稳定版本:1.0.0
Composer 安装命令:
composer require kenshodigital/kirby-minify
包简介
Minifies HTML and XML output for Kirby projects.
README 文档
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
统计信息
- 总下载量: 41
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-06