| 1 |
--- |
| 2 |
title: resources.Match |
| 3 |
description: Returns a collection of global resources from paths matching the given glob pattern, or nil if none found. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
params: |
| 7 |
functions_and_methods: |
| 8 |
aliases: [] |
| 9 |
returnType: resource.Resources |
| 10 |
signatures: [resources.Match PATTERN] |
| 11 |
--- |
| 12 |
|
| 13 |
```go-html-template |
| 14 |
{{ range resources.Match "images/*.jpg" }} |
| 15 |
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt=""> |
| 16 |
{{ end }} |
| 17 |
``` |
| 18 |
|
| 19 |
> [!NOTE] |
| 20 |
> This function operates on global resources. A global resource is a file within the `assets` directory, or within any directory mounted to the `assets` directory. |
| 21 |
> |
| 22 |
> For page resources, use the [`Resources.Match`][] method on a `Page` object. |
| 23 |
|
| 24 |
Hugo determines a match using a case-insensitive [glob pattern](g). For syntax rules and examples, see the [glob patterns quick reference guide][]. |
| 25 |
|
| 26 |
[`Resources.Match`]: /methods/page/resources/#match |
| 27 |
[glob patterns quick reference guide]: /quick-reference/glob-patterns/ |