Can hugo bundles do this?

I came across hugo bundles and was thinking if hugo could achieve this, or do you guys think i am just wasting my thinking about it.

content
   posts
      article-1
         index.md
         images
            image-1.jpg
            image-2.jpg
         notes
            note1.md
            note2.md

Now the real question :smiley:

while i am looping through posts, within that context can I loop through files in images and notes too? If so how…? Assuming the use case would be that the number of files within images directory or notes directory is unknown and more than 1.

Yes. The “how” should be in the docs, but a hint could be to have a look at .Page.Resources and also .Page.Resources.Match.

Wow… That was quick. :slight_smile:
Thanks for the quick turn around. I will give that a try.

It worked. Thanks for the help @bep

FYI, to any one who want to do the same as me

{{ range .Page.Resources.Match "notes/*.md" }}
      <p>
        {{ .Params.name }}
        {{ .Params.email }}
        {{ .Params.comment }}
      </p>
{{ end }}
2 Likes