mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-15 20:44:01 +02:00
hugolib: Allow relative URLs in front matter
Before this commit you would have to do this in multilingual setups: ``` --- title: "Custom!" url: "/jp/custom/foo" --- ``` This commit allows for relative URLs, e.g: ``` --- title: "Custom!" url: "custom/foo" --- ``` Which is obviously easier and more portable. The meaning of relative may change to include more in the future (e.g. role based access). Fixes #5704
This commit is contained in:
@@ -208,7 +208,7 @@ func (s *Site) render404() error {
|
||||
s: s,
|
||||
kind: kind404,
|
||||
urlPaths: pagemeta.URLPath{
|
||||
URL: path.Join(s.GetURLLanguageBasePath(), "404.html"),
|
||||
URL: "404.html",
|
||||
},
|
||||
},
|
||||
output.HTMLFormat,
|
||||
@@ -271,7 +271,7 @@ func (s *Site) renderRobotsTXT() error {
|
||||
s: s,
|
||||
kind: kindRobotsTXT,
|
||||
urlPaths: pagemeta.URLPath{
|
||||
URL: path.Join(s.GetURLLanguageBasePath(), "robots.txt"),
|
||||
URL: "robots.txt",
|
||||
},
|
||||
},
|
||||
output.RobotsTxtFormat)
|
||||
|
Reference in New Issue
Block a user