Range through a folder of images in /assets/

I can’t find anything specific to my use case, and I’m having trouble sorting it out from the docs.

I want to range through a folder of images.

In my assets directory I have => \assets\images\gallery\

gallery is full of .jpg images, and I just want to range through them, as such:


    {{ range $images }}
      <div>
        <div>
          <div>
            <img src="{{ .Content }}">
            <div>
              <h2>THE SUBTITLE</h2>
              <h1>Shooting Stars</h1>
              <p Photo booth fam kinfolk cold-pressed sriracha leggings jianbing microdosing tousled waistcoat.</p>
            </div>
          </div>
        </div>
      {{ end }}

(I removed all of the tailwinds classes for easier reading)

Here’s the repo link: GitHub - bootyocean18/COLIM: Central Ohio Lutheran Immigrant Mission

Here’s the live site: https://colim.netlify.app

1 Like
{{ range resources.Match "images/gallery/*" }}
  <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ end }}
2 Likes

I was close! I was guessing resources.GetMatch

A post was split to a new topic: JS array of images

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