package reflect

import "github.com/gohugoio/hugo/tpl/reflect"

Package reflect provides template functions for run-time object reflection.

Index

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

func (ns *Namespace) IsImageResource(v any) bool

IsImageResource reports whether v is a Image Resource.

func (*Namespace) IsImageResourceProcessable

func (ns *Namespace) IsImageResourceProcessable(v any) bool

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

func (ns *Namespace) IsImageResourceWithMeta(v any) bool

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

func (ns *Namespace) IsMap(v any) bool

IsMap reports whether v is a map.

func (*Namespace) IsPage

func (ns *Namespace) IsPage(v any) bool

IsPage reports whether v is a Hugo Page.

func (*Namespace) IsResource

func (ns *Namespace) IsResource(v any) bool

IsResource reports whether v is a Hugo Resource.

func (*Namespace) IsSite

func (ns *Namespace) IsSite(v any) bool

IsSite reports whether v is a Hugo Site.

func (*Namespace) IsSlice

func (ns *Namespace) IsSlice(v any) bool

IsSlice reports whether v is a slice.

Source Files

init.go reflect.go

Version
v0.165.0 (latest)
Published
Aug 12, 2026
Platform
linux/amd64
Imports
8 packages
Last checked
3 hours ago

Tools for package owners.