HUGO
Menu
GitHub 89759 stars Mastodon

resources.Publish

Publishes the given resource and returns it.

Syntax

resources.Publish RESOURCE

Returns

resource.Resource
New in v0.166.0

The resources.Publish function writes the given resource to the publishDir and returns the resource, making it useful within a template pipeline.

{{ resources.Get "main.js" | js.Build | resources.Publish }}

This is equivalent to:

{{ (resources.Get "main.js" | js.Build).Publish }}

See the Publish method for the non-pipeline form.