Clearly the docs haven’t had a chance to catch up yet. Everyone is busy of course.
The Resources feature has been extended to allow the use of the pipeline and the source for the non-post resources is the assets folder. The pipeline will “compile” the resources into the resources folder which you will need to make available to your server (the assets folder doesn’t need to be accessible to the server). The href link will point to the resources folder.
I started a new site with Hugo 0.44 just to see if such /assets dir would appear somewhere, but there wasn’t one. I manually made one inside my theme dir and moved everything from /static there. However, apparently I need an extended Hugo version in order to get SCSS processing and it’s not available from Chocolatey.
I think I’ll wait for docs update and the extended build from Choco before further experiments
Resources.Get uses the normal lookup order, so the top-level asset folder is checked first and then your theme asset folder.
Resources.Get generates a file in your resources directory and .Permalink references that generated resource. For example, when using image processing, the post-processed image is generated in the resources directory and you use $permalink to reference it:
Thanks for putting this together. I’m looking at it now and it’s very helpful. Have you thought about cross-posting this kind of stuff on Steemit now that Medium requires users to pay to comment?
Regarding Concat it’s worth noting bundling isn’t always necessary, and, in fact, can hurt performance and increase perceived latency. The latency concatenation adds is probably the main driver behind the Webpack CommonsChunkPlugin. Rather than downloading all the JS in one go it’s oftentimes more performant to download necessary scripts in parallel, asynchronously and only execute them as necessary.
If you don’t use Webpack there’s a tiny zero-dependency library I wrote which can achieve a similar result. Thanks again for the post!