diff options
author | Bjørn Erik Pedersen <[email protected]> | 2019-03-31 12:08:15 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2019-04-02 10:33:15 +0200 |
commit | 5185fb065b0f8a4142c29ee3e3cd917e917280a4 (patch) | |
tree | c4aad127193563eabac21e76cfc4e8e19408b155 /hugolib/site_render.go | |
parent | 92baa14fd3f45c0917c5988235cd1a0f8692f171 (diff) | |
download | hugo-5185fb065b0f8a4142c29ee3e3cd917e917280a4.tar.gz hugo-5185fb065b0f8a4142c29ee3e3cd917e917280a4.zip |
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
Diffstat (limited to 'hugolib/site_render.go')
-rw-r--r-- | hugolib/site_render.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hugolib/site_render.go b/hugolib/site_render.go index 3c0897d2e..cf3755b92 100644 --- a/hugolib/site_render.go +++ b/hugolib/site_render.go @@ -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) |