Closed Jieiku closed 4 years ago
build check is failing because ../../public does not exist unless this theme is part of a hugo site. So im not sure if this could cause an issue on a fresh install, possibly it could, maybe the solution would be to have it create ../../public prior to running the html build. Then it would not matter.
I am not sure what would be best to do on this one, so I will wait for your input. Let me know what you recommend and I can clean it up, unless you would rather do it yourself.
Thanks :+1:
I have asked at the project, if it is possible to overwrite existing files: https://github.com/kangax/html-minifier/issues/1062
HTML (and CSS) are gzipped by the web server transparently, making minimization unnecessary. See attached screenshot from my blog:
Yes, you are right, I just really like clean looking source code. I guess you could say I am a bit OCD.
Edit: this post reminded me what I need to work on next, always something to work on.
I guess this belongs in your theme itself as some sort of post-Hugo processing step then. Or in a git pre-commit hook (if your blog is in git). :P
cd ~/hugo/mysite/themes/hugo-theme-bootstrap4-blog npm install html-minifier
html-minifier, by default --preserve-line-breaks to keep code readable, can be further minified if that parameter is removed.
Please look it over to make sure its ready for the masses. This is working great on my site for cleaning up the html source code.
OH! Also after running npm run build and hugo -D next I overwrite the contents of /public with /public-out overwriting the original files with minified files.