This partial is working well but I would like to replace the list of css by implementing bundle css with {{ range }} and Concat functions if possible.
All css files are located in theme directory assets/css.
I guess that means that .Resources.GetMatch “css/**.css” did not match anything. We should consider improving the error handling here, but you can start by doing something ala this:
Thanks for your support.
But I still got the error message ERROR 2019/05/10 13:54:16 Bundled CSS not found
I don’t understand why as I actually get 4 css files in assets/css directory.
Thanks for the explanation,
But it’s what I did (see my first post) and it works well.
What I am trying to do is to avoid typing all css files and let Hugo do the job through the resources.Get "css/**.css" function.
With your explanation and the Hugo docs, I understood that it is not possible as this function is dedicated to the Page or Leaf bundles.
Am I correct ?
It works !!
But only with the css files located in the assets/css at root directory of the site. Not at the theme directory as initially done.
In addition, the fonts location (or URL) has been lost (implemented in a separate fonts.css (same location)
I guess it’s something related to the absolute or relative path, but I am not skilled at all to investigate further.
Thank you.
If I maintain the same structure (assets at the theme directory) the partial doesn’t work. If I move the assets/css at the upper level, meaning at the site root, it works.
Ah I see. This is because the code snippet above is reading CSS files from dir assets/css. You could change that to themes/basic/assets/css if you wanted.
The above is a minimal working example. But can obviously be made smarter.
For example one could make it walk each dir under themes then add all of the found CSS files to a big slice.