pug
html-minifier-terser
pug | html-minifier-terser | |
---|---|---|
2 | 2 | |
381 | 343 | |
0.5% | 1.8% | |
4.1 | 4.6 | |
8 months ago | 6 months ago | |
PHP | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pug
-
Write HTML Right
HTML can't be fixed with a small trick like that.
Just use templating engine like Pug and get away with most of the annoyances.
It's concise about what part of the text is covered by a certain tag due to forced indentation and you never write "class=" but are all turned into CSS selector notation and many other tricks.
https://github.com/pugjs/pug#syntax
Unless the HTML I'm composing will be touched by people like designers who would get scared of new syntax, in which case I'll use Twig or Nunjucks, I'll never write plain HTML for myself.
There's also a very solid implementation in PHP as well.
https://github.com/pug-php/pug
-
How do I stop my closing tag from shifting all the way left all the time? This is driving me nuts. I just want it to be aligned with its opening tag when closing it.
Pug is great, and since OP is coding PHP, pug-php might be of interest.
html-minifier-terser
- Top 25 Tips for Building an EXTREMELY FAST Website!!!
-
Write HTML Right
I've been using https://github.com/terser/html-minifier-terser to get this kind of HTML for my personal site for a while. It passes W3C so I'm happy.
What are some alternatives?
Twig - Twig, the flexible, fast, and secure template language for PHP
terser-webpack-plugin - Terser Plugin
laravel-database-mail-templates - Render Laravel mailables based on a mail template stored in the database
SingleFile - Web Extension for saving a faithful copy of a complete web page in a single HTML file
Jade - Jade.go - pug template engine for Go (golang)
browserslist - 🦔 Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-preset-env
Jade - Pug – robust, elegant, feature rich template engine for Node.js
terser - 🗜 JavaScript parser, mangler and compressor toolkit for ES6+ [Moved to: https://github.com/terser/terser]
atto-php - AttoPHP is a tool based on the builder pattern to configure, route and render a website in no time.
lighthouse - Automated auditing, performance metrics, and best practices for the web.
hn-search - Hacker News Search
svgomg - Web GUI for SVGO