urls

package
v0.112.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseURL added in v0.112.0

type BaseURL struct {
	WithPath    string
	WithoutPath string
	BasePath    string
	// contains filtered or unexported fields
}

A BaseURL in Hugo is normally on the form scheme://path, but the form scheme: is also valid (mailto:hugo@rules.com).

func NewBaseURLFromString added in v0.112.0

func NewBaseURLFromString(b string) (BaseURL, error)

func (BaseURL) HostURL added in v0.112.0

func (b BaseURL) HostURL() string

HostURL returns the URL to the host root without any path elements.

func (BaseURL) Path added in v0.112.0

func (b BaseURL) Path() string

func (BaseURL) Port added in v0.112.0

func (b BaseURL) Port() int

func (BaseURL) String added in v0.112.0

func (b BaseURL) String() string

func (BaseURL) URL added in v0.112.0

func (b BaseURL) URL() *url.URL

URL returns a copy of the internal URL. The copy can be safely used and modified.

func (BaseURL) WithPort added in v0.112.0

func (b BaseURL) WithPort(port int) (BaseURL, error)

func (BaseURL) WithProtocol added in v0.112.0

func (b BaseURL) WithProtocol(protocol string) (BaseURL, error)

WithProtocol returns the BaseURL prefixed with the given protocol. The Protocol is normally of the form "scheme://", i.e. "webcal://".

type RefLinker

type RefLinker interface {
	Ref(args map[string]any) (string, error)
	RelRef(args map[string]any) (string, error)
}

RefLinker is implemented by those who support reference linking. args must contain a path, but can also point to the target language or output format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL