Debian Codegraph @

docs/content/en/functions/resources/Get.md

raw
1 ---
2 title: resources.Get
3 description: Returns a global resource from the given path, or nil if none found.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 aliases: []
9 returnType: resource.Resource
10 signatures: [resources.Get PATH]
11 ---
12
13 ```go-html-template
14 {{ with resources.Get "images/a.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.Get`][] method on a `Page` object.
23
24 [`Resources.Get`]: /methods/page/resources/#get