Wildcards with Hugo Pipes?

I would like to use Hugo Pipes for bundling a load of CSS files for a modular CSS project.

Is it possible to use wildcards with Hugo Pipes? Something like this:

'./src/03-objects/**/**/*.css'

I’m pretty rusty with all things Hugo and web design, so wanted to ask first before diving in! Thank you :slightly_smiling_face:

  • You cannot use wildcards when mounting a module
  • But you can use wildcards when looking for ressources in a given mount, see resources.Match.
1 Like

Fabulous, thank you :slightly_smiling_face:. That’s my homework sorted for this evening!

I’ve managed to get this working. Firstly, set the mount for theme assets directory in config.yml

# Set mount for theme assets directory
module:
  mounts:
  - source: /themes/godule/assets
    target: assets

Then {{ $css := resources.Match "**/*.css" }} in the partial head.html returns an array of CSS files in the top level of the assets directory. Which is nice. Here’s a snapshot of where I’m at:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.