package reflect
import "github.com/gohugoio/hugo/tpl/reflect"
Package reflect provides template functions for run-time object reflection.
Index ¶
- type Namespace
- func New() *Namespace
- func (ns *Namespace) IsImageResource(v any) bool
- func (ns *Namespace) IsImageResourceProcessable(v any) bool
- func (ns *Namespace) IsImageResourceWithMeta(v any) bool
- func (ns *Namespace) IsMap(v any) bool
- func (ns *Namespace) IsPage(v any) bool
- func (ns *Namespace) IsResource(v any) bool
- func (ns *Namespace) IsSite(v any) bool
- func (ns *Namespace) IsSlice(v any) bool
Types ¶
type Namespace ¶
type Namespace struct{}
Namespace provides template functions for the "reflect" namespace.
func New ¶
func New() *Namespace
New returns a new instance of the reflect-namespaced template functions.
func (*Namespace) IsImageResource ¶
IsImageResource reports whether v is a Image Resource.
func (*Namespace) IsImageResourceProcessable ¶
IsImageResourceProcessable reports whether v is a Image Resource that supports all image processing operations like Resize, Crop, etc. in addition to the metadata operations.
func (*Namespace) IsImageResourceWithMeta ¶
IsImageResourceWithMeta reports whether v is a Image Resource that supports at least the image metadata operations Width and Height and Meta (for e.g. Exif). This will return true for AVIF, HEIF and HEIC image resources, even if we don't yet support image operations like Resize, Crop, etc. on these formats.
func (*Namespace) IsMap ¶
IsMap reports whether v is a map.
func (*Namespace) IsPage ¶
IsPage reports whether v is a Hugo Page.
func (*Namespace) IsResource ¶
IsResource reports whether v is a Hugo Resource.
func (*Namespace) IsSite ¶
IsSite reports whether v is a Hugo Site.
func (*Namespace) IsSlice ¶
IsSlice reports whether v is a slice.
Source Files ¶
- Version
- v0.165.0 (latest)
- Published
- Aug 12, 2026
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 3 hours ago –
Tools for package owners.