urls

package
v0.123.13 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseURL

type BaseURL struct {
	WithPath                string
	WithPathNoTrailingSlash string
	WithoutPath             string
	BasePath                string
	BasePathNoTrailingSlash 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

func NewBaseURLFromString(b string) (BaseURL, error)

func (BaseURL) HostURL

func (b BaseURL) HostURL() string

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

func (BaseURL) Path

func (b BaseURL) Path() string

func (BaseURL) Port

func (b BaseURL) Port() int

func (BaseURL) String

func (b BaseURL) String() string

func (BaseURL) URL

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

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

func (BaseURL) WithProtocol

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