Files
hugo/docs/content/en/functions/reflect/IsResource.md
T
Bjørn Erik Pedersen 30a20122b7 Merge commit '8f3c066d23f431fb2c53d97ea489e4c28b42bd82'
# Conflicts:
#	docs/data/docs.yaml
2026-02-14 12:14:33 +01:00

1.3 KiB

title, description, categories, keywords, params
title description categories keywords params
reflect.IsResource Reports whether the given value is a Resource object.
functions_and_methods
aliases returnType signatures
bool
reflect.IsResource INPUT

{{< new-in 0.154.0 />}}

With this project structure:

project/
├── assets/
│   ├── a.json
│   ├── b.avif
│   └── c.jpg
└── content/
    └── example/
        ├── index.md
        ├── d.json
        ├── e.avif
        └── f.jpg

These are the values returned by the reflect.IsResource function:

{{ with resources.Get "a.json" }}
  {{ reflect.IsResource . }} → true
{{ end }}

{{ with resources.Get "b.avif" }}
  {{ reflect.IsResource . }} → true
{{ end }}

{{ with resources.Get "c.jpg" }}
  {{ reflect.IsResource . }} → true
{{ end }}
{{ with .Resources.Get "d.json" }}
  {{ reflect.IsResource . }} → true
{{ end }}

{{ with .Resources.Get "e.avif" }}
  {{ reflect.IsResource . }} → true
{{ end }}

{{ with .Resources.Get "f.jpg" }}
  {{ reflect.IsResource . }} → true
{{ end }}
{{ with site.GetPage "/example" }}
  {{ reflect.IsResource . }} → true
{{ end }}