4rn0 / statamic-minifyhtml Goto Github PK
View Code? Open in Web Editor NEWStatamic v2 Addon to minify HTML responses
License: MIT License
Statamic v2 Addon to minify HTML responses
License: MIT License
When the control panel is disabled with $control_panel = false;
the HTML minification is not working at all. I think could be fixed by checking if CP_ROUTE
has been defined in the isNotControlPanel
function. https://github.com/4rn0/statamic-minifyhtml/blob/master/MinifyHTML/MinifyHTMLMiddleware.php#L73
protected function isNotControlPanel()
{
if (!CP_ROUTE) {
return true;
}
return !request()->is( CP_ROUTE . '*');
}
Hi there,
First thanks for this Statamic addon.
I've create something similar for Grav CMS.
To compress HTML, I use a very powerful PHP library: wyrihaximus/html-compress
It has good performance and some nice options, plus it's very easy to use.
If you're interested, you could have a look to my Grav plugin here, it may help you: jimblue/grav-plugin-minify-html
Cheers
Because of the conditional statements in antlers my source HTML looks really bad with crazy spaces and line breaks everywhere. I am offering to pay you to update this.
Thanks a ton for this! It works great! Almost exactly what I was looking for except it is leaving all HTML comments and I thought for sure it would strip comments before minifying. This would be a great feature because we could leave all our comments for easy dev but they wouldn't show in production.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.