Do not add lang prefix in URL when set in frontmatter

Fixes #2450
This commit is contained in:
Bjørn Erik Pedersen
2016-09-14 18:51:34 +02:00
parent dd45e6d7e5
commit bbb11a4a0f
2 changed files with 17 additions and 2 deletions

View File

@@ -644,6 +644,16 @@ func (p *Page) Permalink() (string, error) {
return link.String(), nil
}
func (p *Page) URL() string {
if p.URLPath.URL != "" {
// This is the url set in front matter
return p.URLPath.URL
}
// Fall back to the relative permalink.
u, _ := p.RelPermalink()
return u
}
func (p *Page) RelPermalink() (string, error) {
link, err := p.permalink()
if err != nil {