resources.GetMatch

resources.GetMatch


Returns the first global resource from paths matching the given glob pattern, or nil if none found.

{{ with resources.GetMatch "images/*.jpg" }}
  <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ end }}

Hugo determines a match using a case-insensitive [glob pattern].