Fix URLs for sites where baseURL is not the domain root
It turns out that the fix for static links in 6528985ed breaks
sites where baseURL is not at the domain root, (i.e. the Hugo site
is at http://www.example.com/foo/, not http://www.example.com/).
This is because the link strings passed to absURL and absLangURL
have a leading slash, which Hugo resolves to the domain root. This
commit fixes the problem by removing removing the leading slash
from these strings.
Fixes #57
This commit is contained in:
parent
d64afa3e2b
commit
54959770bf
4 changed files with 17 additions and 16 deletions
|
|
@ -50,12 +50,12 @@ pygmentCodeFences = true
|
|||
|
||||
[[menu.main]]
|
||||
name = "Blog"
|
||||
url = "/"
|
||||
url = ""
|
||||
weight = 1
|
||||
|
||||
[[menu.main]]
|
||||
name = "About"
|
||||
url = "/page/about/"
|
||||
url = "page/about/"
|
||||
weight = 3
|
||||
|
||||
[[menu.main]]
|
||||
|
|
@ -66,22 +66,23 @@ pygmentCodeFences = true
|
|||
[[menu.main]]
|
||||
parent = "samples"
|
||||
name = "Big Image Sample"
|
||||
url = "/post/2017-03-07-bigimg-sample"
|
||||
url = "post/2017-03-07-bigimg-sample"
|
||||
weight = 1
|
||||
|
||||
[[menu.main]]
|
||||
parent = "samples"
|
||||
name = "Math Sample"
|
||||
url = "/post/2017-03-05-math-sample"
|
||||
url = "post/2017-03-05-math-sample"
|
||||
weight = 2
|
||||
|
||||
[[menu.main]]
|
||||
parent = "samples"
|
||||
name = "Code Sample"
|
||||
url = "/post/2016-03-08-code-sample"
|
||||
url = "post/2016-03-08-code-sample"
|
||||
weight = 3
|
||||
|
||||
[[menu.main]]
|
||||
name = "Tags"
|
||||
url = "/tags"
|
||||
url = "tags"
|
||||
weight = 3
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue