thegeeklab / hugo-geekdoc

Hugo theme made for documentation

Home Page:https://geekdocs.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reducing release size (Suggestion)

d1nuc0m opened this issue · comments

EDIT: I made a mess with folder, can't estimate correctly file saving
Hi, I was experimenting to reduce the size of the "static" folder of the release, I managed to shrink it down somehow. Theoretically the process is lossless and the theme should work as usual, but this is to be verified. Also, I don't know if these steps go against the licenses (for example removing credit metadata etc)

Note: I applied the changes manually to the release, I don't know and how if these can be integrated in the current npm pipeline.

Css

As I didn't know how to integrate it with the build, I manually processed the file with the online version of CSSNANO (Advanced preset). Note that CSSNANO is made to be used with npm.

Favicon

optipng with optipng -o7 -zm1-9

Fonts

Probably there is a way to further improve the WOFF/WOFF2 compression used, I had some results with woff-compress with Zopfli.

Img and all the SVGs

svgo with svgo --multipass --pretty --final-newline

Js

Applied it to already minimized files and still reduced filesize. The result would probably be better when applied during the proper build pipeline.
UglifyJS 3 with uglifyjs -c -m --no-annotations --toplevel --validate

Hope this might be useful

I appreciate the effort but to be honest Im not a fan of such optimizations. Everyone can apply it to the theme during a deployment but for the official releases I would like to keep it as it is. Most files are minified already and using a proper deployment/cache settings the theme is using ~600-800kb which is fine IMO.

I appreciate the effort but to be honest Im not a fan of such optimizations. Everyone can apply it to the theme during a deployment but for the official releases I would like to keep it as it is. Most files are minified already and using a proper deployment/cache settings the theme is using ~600-800kb which is fine IMO.

Thank you :)