mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
tpl/urls: Make urlize return a string
Like it did in 0.20.
This commit is contained in:
@@ -54,12 +54,12 @@ func (ns *Namespace) RelURL(a interface{}) (template.HTML, error) {
|
|||||||
return template.HTML(ns.deps.PathSpec.RelURL(s, false)), nil
|
return template.HTML(ns.deps.PathSpec.RelURL(s, false)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ns *Namespace) URLize(a interface{}) (template.URL, error) {
|
func (ns *Namespace) URLize(a interface{}) (string, error) {
|
||||||
s, err := cast.ToStringE(a)
|
s, err := cast.ToStringE(a)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
return template.URL(ns.deps.PathSpec.URLize(s)), nil
|
return ns.deps.PathSpec.URLize(s), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type reflinker interface {
|
type reflinker interface {
|
||||||
|
Reference in New Issue
Block a user