package urls
import "github.com/gohugoio/hugo/common/urls"
Index ¶
- type BaseURL
- func NewBaseURLFromString(b string) (BaseURL, error)
- func (b BaseURL) HostURL() string
- func (b BaseURL) Path() string
- func (b BaseURL) Port() int
- func (b BaseURL) String() string
- func (b BaseURL) URL() *url.URL
- func (b BaseURL) WithPort(port int) (BaseURL, error)
- func (b BaseURL) WithProtocol(protocol string) (BaseURL, error)
- type RefLinker
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 (BaseURL) HostURL ¶
HostURL returns the URL to the host root without any path elements.
func (BaseURL) Path ¶
func (BaseURL) Port ¶
func (BaseURL) String ¶
func (BaseURL) URL ¶
URL returns a copy of the internal URL. The copy can be safely used and modified.
func (BaseURL) WithPort ¶
func (BaseURL) WithProtocol ¶
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.
Source Files ¶
- Version
- v0.144.2 (latest)
- Published
- Feb 19, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 13 hours ago –
Tools for package owners.