HUGO
News Docs Themes Community GitHub

Colors

RESOURCE.Colors

Applicable to images, returns a slice of the most dominant colors using a simple histogram method.

Content

RESOURCE.Content

Returns the content of the given resource.

Crop

RESOURCE.Crop SPEC

Applicable to images, returns an image resource cropped to the given dimensions without resizing.

Data

RESOURCE.Data

Applicable to resources returned by the resources.GetRemote function, returns information from the HTTP response.

Err

RESOURCE.Err

Applicable to resources returned by the resources.GetRemote function, returns an error message if the HTTP request fails, else nil.

Exif

RESOURCE.Exif

Applicable to JPEG, PNG, TIFF, and WebP images, returns an EXIF object containing image metadata.

Fill

RESOURCE.Fill SPEC

Applicable to images, returns an image resource cropped and resized to the given dimensions.

Filter

RESOURCE.Filter FILTER...

Applicable to images, applies one or more image filters to the given image resource.

Fit

RESOURCE.Fit SPEC

Applicable to images, returns an image resource downscaled to fit the given dimensions while maintaining aspect ratio.

Height

RESOURCE.Height

Applicable to images, returns the height of the given resource.

MediaType

RESOURCE.MediaType

Returns a media type object for the given resource.

Name

RESOURCE.Name

Returns the name of the given resource as optionally defined in front matter, falling back to its file path.

Params

RESOURCE.Params

Returns a map of resource parameters as defined in front matter.

Permalink

RESOURCE.Permalink

Publishes the given resource and returns its permalink.

Process

RESOURCE.Process SPEC

Applicable to images, returns an image resource processed with the given specification.

Publish

RESOURCE.Publish

Publishes the given resource.

RelPermalink

RESOURCE.RelPermalink

Publishes the given resource and returns its relative permalink.

Resize

RESOURCE.Resize SPEC

Applicable to images, returns an image resource resized to the given width and/or height.

ResourceType

RESOURCE.ResourceType

Returns the main type of the given resource's media type.

Title

RESOURCE.Title

Returns the title of the given resource as optionally defined in front matter, falling back to a relative path or hashed file name depending on resource type.

Width

RESOURCE.Width

Applicable to images, returns the width of the given resource.