Documentation on .Resources / bundled content

Is there any documentation I am missing beyond

After looking through the 0.32 release notes from last month and making a few attempts to use the asset bundling code, I’d have to say it seems like it’s definitely still working out it’s sea legs.

Just to confirm… the bundle feature is primarily focused around image processing/reference, correct?

I ask this because bep has called out that JSON support is mainly focused on front end javascript support (Hugo 0.32 Related Questions/Discussions).

Right now I’m in the boat where I have a few hundred MP3 files. Currently Hugo can’t introspect any of the ID3 content, so the next step was to extract it into JSON and just have each directory have a file called “media.json” to read in. Honestly, I would prefer not to deal with a JSON file at all, but it seems equally weird to just shove all of that in the front matter rather than managing the files+metadata as a bundled unit.

I’ve tried to read this for typos, but I’m falling asleep and have lost about 4 hours of my life to trying to figure this out.

Currently no.

This is being refined every week since .32

In the mean time, there are a few threads you can read on and googling you can do to learn more about the matter. (Search for “Page Resources”, “metadata”)

Also the GitHub commits/PR are a detailed read, @bep documents heavily in his code:

Have a good read.

I really like to start using resources and page bundles as well, but it’s hard without coherent documentation. I’ve also tried a few hours trying to get it to work. What’s currently the best place to start to get a hang of this (I believe, very powerful) feature of Hugo?

Start here:

And follow the blue links to resources and image processing.

The “bundle part” of this is very short at the moment. But it is a simple concept if you can wrap your head around it:


It you focus on the variant, it means that any file in that same folder and below will become resources in that bundle. And that images will get “special power”.

If that isn’t “coherent” enough, I siggest you revisit this in some time. We should eventually get around to it.

Thanks, @bep! I’m starting to understand it :slight_smile:

Now, I’ve created a folder with the name of my post and used this structure:

├── name-of-the-blog-post
│   ├── image1.jpg
│   ├── image2.jpg
│   ├──

When I use this code, it works:

{{ $images := .Resources.ByType "image" }} 
{{ range $images }}
    {{ $image := .Resize "500x" }}
    <img src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" />         
{{ end }}

I prefer to have my posts as instead of foldes with an index.html file. Is there an other way to automatically create a bundle for a specific page? For example, by creating a folder on the same level, with the same name as the markdown file? Like so:

├── name-of-the-blog-post (resource folder)
│   ├── image1.jpg
│   ├── image2.jpg


The name of your main bundle file (e.g. is more or less set in stone (naming schemes such as this breaks fast when you start to say “I prefer a completely different setup …”). But you have endless flexibility in the URL scheme. And for all practical use, the bundle folder name will be used.

Okay, I understand. Thanks for your quick reply! So, then, when creating new content, I should do it like this?

hugo new blog/new-post/

Is there a setting (or would it be a good idea?) to have ‘bundle’ folders by default? So, when I do:

hugo new blog/new-post

… it would create a folder with already inside of it?


But now I think you are drifting pretty far from this topic’s title. Start new thread(s) for further questions on this topic.

1 Like