package resources
import "github.com/gohugoio/hugo/tpl/resources"
Package resources provides template functions for working with resources.
Index ¶
- type Namespace
- func New(deps *deps.Deps) (*Namespace, error)
- func (ns *Namespace) Concat(targetPathIn interface{}, r interface{}) (resource.Resource, error)
- func (ns *Namespace) ExecuteAsTemplate(args ...interface{}) (resource.Resource, error)
- func (ns *Namespace) Fingerprint(args ...interface{}) (resource.Resource, error)
- func (ns *Namespace) FromString(targetPathIn, contentIn interface{}) (resource.Resource, error)
- func (ns *Namespace) Get(filename interface{}) (resource.Resource, error)
- func (ns *Namespace) Minify(r resource.Resource) (resource.Resource, error)
- func (ns *Namespace) PostCSS(args ...interface{}) (resource.Resource, error)
- func (ns *Namespace) ToCSS(args ...interface{}) (resource.Resource, error)
Types ¶
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace provides template functions for the "resources" namespace.
func New ¶
New returns a new instance of the resources-namespaced template functions.
func (*Namespace) Concat ¶
Concat concatenates a slice of Resource objects. These resources must (currently) be of the same Media Type.
func (*Namespace) ExecuteAsTemplate ¶
ExecuteAsTemplate creates a Resource from a Go template, parsed and executed with the given data, and published to the relative target path.
func (*Namespace) Fingerprint ¶
Fingerprint transforms the given Resource with a MD5 hash of the content in the RelPermalink and Permalink.
func (*Namespace) FromString ¶
FromString creates a Resource from a string published to the relative target path.
func (*Namespace) Get ¶
Get locates the filename given in Hugo's filesystems: static, assets and content (in that order) and creates a Resource object that can be used for further transformations.
func (*Namespace) Minify ¶
Minify minifies the given Resource using the MediaType to pick the correct minifier.
func (*Namespace) PostCSS ¶
PostCSS processes the given Resource with PostCSS
func (*Namespace) ToCSS ¶
ToCSS converts the given Resource to CSS. You can optional provide an Options object or a target path (string) as first argument.
Source Files ¶
- Version
- v0.56.0
- Published
- Jul 25, 2019
- Platform
- linux/amd64
- Imports
- 15 packages
- Last checked
- 5 minutes ago –
Tools for package owners.