package urls
import "github.com/gohugoio/hugo/tpl/urls"
Index ¶
- type Namespace
- func New(deps *deps.Deps) *Namespace
- func (ns *Namespace) AbsLangURL(a interface{}) (template.HTML, error)
- func (ns *Namespace) AbsURL(a interface{}) (template.HTML, error)
- func (ns *Namespace) Parse(rawurl interface{}) (*url.URL, error)
- func (ns *Namespace) Ref(in interface{}, refs ...string) (template.HTML, error)
- func (ns *Namespace) RelLangURL(a interface{}) (template.HTML, error)
- func (ns *Namespace) RelRef(in interface{}, refs ...string) (template.HTML, error)
- func (ns *Namespace) RelURL(a interface{}) (template.HTML, error)
- func (ns *Namespace) URLize(a interface{}) (string, error)
Types ¶
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace provides template functions for the "urls" namespace.
func New ¶
New returns a new instance of the urls-namespaced template functions.
func (*Namespace) AbsLangURL ¶
AbsLangURL takes a given string and converts it to an absolute URL according to a page's position in the project directory structure and the current language.
func (*Namespace) AbsURL ¶
AbsURL takes a given string and converts it to an absolute URL.
func (*Namespace) Parse ¶
Parse parses rawurl into a URL structure. The rawurl may be relative or absolute.
func (*Namespace) Ref ¶
Ref returns the absolute URL path to a given content item.
func (*Namespace) RelLangURL ¶
RelLangURL takes a given string and prepends the relative path according to a page's position in the project directory structure and the current language.
func (*Namespace) RelRef ¶
RelRef returns the relative URL path to a given content item.
func (*Namespace) RelURL ¶
RelURL takes a given string and prepends the relative path according to a page's position in the project directory structure.
func (*Namespace) URLize ¶
URLize returns the given argument formatted as URL.
Source Files ¶
- Version
- v0.32.3
- Published
- Jan 8, 2018
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 3 hours ago –
Tools for package owners.