gokarna-theme / gokarna-hugo

A minimal opinionated theme for Hugo
https://gokarna-hugo.netlify.app
GNU General Public License v3.0
357 stars 139 forks source link

Use hugo pipes for asset processing #173

Closed davidkroell closed 1 year ago

davidkroell commented 1 year ago

Advantage

This is mainly for speed purpose. By using Hugo pipes, different actions can be applied to the asset files, such as minification of CSS and JS, which should result is better loading time, which in turn increases the usability.

Furthermore, assets which were not found are leading to build errors, not runtime errors. In extend, no more handmade URL-building is required. Also integrity attributes for javascript files are added.

Should also increase developer experience because files in the static folder are sometimes not rebuilt during development with hugo serve (at least I experienced it this way).

Changes

netlify[bot] commented 1 year ago

Deploy Preview for gokarna-hugo ready!

Name Link
Latest commit c2f383d487061d77d0861b02d89f676138cb3b0e
Latest deploy log https://app.netlify.com/sites/gokarna-hugo/deploys/6485dc79e541480008edb80b
Deploy Preview https://deploy-preview-173--gokarna-hugo.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

davidkroell commented 1 year ago

Edit: Added bundling of JavaScript files

yashmehrotra commented 1 year ago

@526avijitgupta @davidkroell

Will this break existing sites since we are changing the base asset path ? For people who added extra assets on their own, will serve from the old static directory

Should we create/pin an issue to handle those queries ?

davidkroell commented 1 year ago

No, does not break anything, since these additional static assets are still served from the same URL and can be embedded withing customHeadHTML as usual.

Nevertheless, you can mention it somewhere that the assets are bundled and minified now.