package create

import "github.com/gohugoio/hugo/resources/resource_factories/create"

Package create contains functions for to create Resource objects. This will typically non-files.

Index

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client contains methods to create Resource objects. tasks to Resource objects.

func New

func New(rs *resources.Spec) *Client

New creates a new Client with the given specification.

func (*Client) FromRemote

func (c *Client) FromRemote(uri string, optionsm map[string]interface{}) (resource.Resource, error)

FromRemote expects one or n-parts of a URL to a resource If you provide multiple parts they will be joined together to the final URL.

func (*Client) FromString

func (c *Client) FromString(targetPath, content string) (resource.Resource, error)

FromString creates a new Resource from a string with the given relative target path.

func (*Client) Get

func (c *Client) Get(filename string) (resource.Resource, error)

Get creates a new Resource by opening the given filename in the assets filesystem.

func (*Client) GetMatch

func (c *Client) GetMatch(pattern string) (resource.Resource, error)

GetMatch gets first resource matching the given pattern from the assets filesystem.

func (*Client) Match

func (c *Client) Match(pattern string) (resource.Resources, error)

Match gets the resources matching the given pattern from the assets filesystem.

Source Files

create.go remote.go

Version
v0.91.2
Published
Dec 23, 2021
Platform
windows/amd64
Imports
23 packages
Last checked
51 minutes ago

Tools for package owners.