All Projects → afbora → kirby-minify-html

afbora / kirby-minify-html

Licence: MIT license
Enable minify HTML output for Kirby 3

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to kirby-minify-html

laravel-mix-kirby
Laravel Mix helper for Kirby
Stars: ✭ 23 (-14.81%)
Mutual labels:  kirby, kirby-cms, kirby-plugin, kirby3
kirby-blade
Enable Laravel Blade Template Engine for Kirby 3
Stars: ✭ 20 (-25.93%)
Mutual labels:  kirby, kirby-cms, kirby-plugin, kirby3-plugin
kirby3-many-to-many-field
This plugin allows you to create many-to-many relationships between pages in Kirby and synchronizes them on both sides.
Stars: ✭ 38 (+40.74%)
Mutual labels:  kirby, kirby-cms, kirby-plugin, kirby3
field-engineer
A Kirby field for complex field structures.
Stars: ✭ 49 (+81.48%)
Mutual labels:  kirby, kirby-cms, kirby-plugin
kirby-highlight
Themeable server-side syntax highlighting for Kirby
Stars: ✭ 14 (-48.15%)
Mutual labels:  kirby, kirby-cms, kirby-plugin
kirby3-ray
Helper tool that enables ray on all the extendable methods.
Stars: ✭ 17 (-37.04%)
Mutual labels:  kirby3, kirby3-cms, kirby3-plugin
k3-image-clip
Visually crop images with a handy image editor directly inside the panel
Stars: ✭ 38 (+40.74%)
Mutual labels:  kirby3, kirby3-cms, kirby3-plugin
kirby-membership
Simple Membership plugin for Kirby CMS
Stars: ✭ 27 (+0%)
Mutual labels:  kirby, kirby-cms, kirby-plugin
kirby-securedpages
Protect pages for authenticated users
Stars: ✭ 28 (+3.7%)
Mutual labels:  kirby-cms, kirby-plugin, kirby3
kirby-boiler-field
Boilerplate for Kirby form fields
Stars: ✭ 15 (-44.44%)
Mutual labels:  kirby, kirby-cms, kirby-plugin
kirby3-bolt
Kirby 3 Plugin for a fast Page lookup even in big content trees
Stars: ✭ 24 (-11.11%)
Mutual labels:  kirby3, kirby3-cms, kirby3-plugin
kirby-podcast
A KirbyCMS-Podcast-Plugin
Stars: ✭ 22 (-18.52%)
Mutual labels:  kirby, kirby-cms, kirby-plugin
kirby3-redirects
Setup HTTP Status Code Redirects from within the Kirby Panel
Stars: ✭ 14 (-48.15%)
Mutual labels:  kirby3, kirby3-cms, kirby3-plugin
kirbyup
🆙 Zero-config bundler for Kirby Panel plugins
Stars: ✭ 33 (+22.22%)
Mutual labels:  kirby, kirby-cms, kirby-plugin
retour-for-kirby
Kirby 3 plugin to manage redirects and track 404s right from the Panel
Stars: ✭ 96 (+255.56%)
Mutual labels:  kirby, kirby-cms, kirby-plugin
kirby3-instagram
Kirby 3 Plugin to call Instagram (or any other) API Endpoints
Stars: ✭ 20 (-25.93%)
Mutual labels:  kirby3, kirby3-cms, kirby3-plugin
kirby3-similar
Find similar collection items based on similarity
Stars: ✭ 16 (-40.74%)
Mutual labels:  kirby-cms, kirby3, kirby3-plugin
kirby3-doctor
Plugin to check health of your CMS installation
Stars: ✭ 19 (-29.63%)
Mutual labels:  kirby3, kirby3-cms, kirby3-plugin
vuekit
Kirby 3 + Vue.js kit
Stars: ✭ 16 (-40.74%)
Mutual labels:  kirby, kirby-cms, kirby3
search-for-kirby
Kirby 3 plugin for adding a search index (sqlite or Algolia).
Stars: ✭ 42 (+55.56%)
Mutual labels:  kirby, kirby-cms, kirby-plugin

Kirby Minify HTML

Enable minify HTML output for Kirby 3

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:

Option Default Values Description
afbora.kirby-minify-html.enabled true boolean Enable/disable minify
afbora.kirby-minify-html.options [] array Minify options *

Available Minify Options

Option Description
doOptimizeViaHtmlDomParser optimize html via "HtmlDomParser()"
doRemoveComments remove default HTML comments (depends on "doOptimizeViaHtmlDomParser(true)")
doSumUpWhitespace sum-up extra whitespace from the Dom (depends on "doOptimizeViaHtmlDomParser(true)")
doRemoveWhitespaceAroundTags remove whitespace around tags (depends on "doOptimizeViaHtmlDomParser(true)")
doOptimizeAttributes optimize html attributes (depends on "doOptimizeViaHtmlDomParser(true)")
doRemoveHttpPrefixFromAttributes remove optional "http:"-prefix from attributes (depends on "doOptimizeAttributes(true)")
doRemoveHttpsPrefixFromAttributes remove optional "https:"-prefix from attributes (depends on "doOptimizeAttributes(true)")
doKeepHttpAndHttpsPrefixOnExternalAttributes keep "http:"- and "https:"-prefix for all external links
doMakeSameDomainsLinksRelative make some links relative, by removing the domain from attributes
doRemoveDefaultAttributes remove defaults (depends on "doOptimizeAttributes(true)"
doRemoveDeprecatedAnchorName remove deprecated anchor-jump (depends on "doOptimizeAttributes(true)")
doRemoveDeprecatedScriptCharsetAttribute remove deprecated charset-attribute - the browser will use the charset from the HTTP-Header, anyway (depends on "doOptimizeAttributes(true)")
doRemoveDeprecatedTypeFromScriptTag remove deprecated script-mime-types (depends on "doOptimizeAttributes(true)")
doRemoveDeprecatedTypeFromStylesheetLink remove "type=text/css" for css links (depends on "doOptimizeAttributes(true)")
doRemoveDeprecatedTypeFromStyleAndLinkTag remove "type=text/css" from all links and styles
doRemoveDefaultMediaTypeFromStyleAndLinkTag remove "media="all" from all links and styles
doRemoveDefaultTypeFromButton remove type="submit" from button tags
doRemoveEmptyAttributes remove some empty attributes (depends on "doOptimizeAttributes(true)")
doRemoveValueFromEmptyInput remove 'value=""' from empty (depends on "doOptimizeAttributes(true)")
doSortCssClassNames sort css-class-names, for better gzip results (depends on "doOptimizeAttributes(true)")
doSortHtmlAttributes sort html-attributes, for better gzip results (depends on "doOptimizeAttributes(true)")
doRemoveSpacesBetweenTags remove more (aggressive) spaces in the dom (disabled by default)
doRemoveOmittedQuotes remove quotes e.g. class="lall" => class=lall
doRemoveOmittedHtmlTags remove ommitted html tags e.g. <p>lall</p> => <p>lall

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']
    ],
];
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].