Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorbep <bjorn.erik.pedersen@gmail.com>2014-12-12 22:28:28 +0300
committerbep <bjorn.erik.pedersen@gmail.com>2015-01-23 16:13:00 +0300
commit1b42dc572a0475596ffc64f8a9e0dbf8ec823094 (patch)
tree3be943bbec8906a7c65bbf992224e0e4c15f5073 /docs
parent743998306a02a683371caeac477501418894a8f5 (diff)
Fix RelPermalink() and Urls in menus vs canonifyUrls
canonifyUrls=true, RelPermalink and baseUrl with sub-path did not work. This fixes that by adding a check for canonifyUrl=trues=true in RelPermalink(). So given - baseUrl "http://somehost.com/sub/" - the path "some-path/file.html" For canonifyUrls=false RelPermalink() returns "/sub/some-path/file.html" For canonifyUrls=true RelPermalink() returns "/some-path/file.html" In the last case, the Url will be made absolute and clickable in a later step. This commit also makes the menu urls defined in site config releative. To make them work with canonifying of urls, the context root is prepended if canonifying is turned off. Fixes #519 Fixes #711
Diffstat (limited to 'docs')
-rw-r--r--docs/content/extras/menus.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/content/extras/menus.md b/docs/content/extras/menus.md
index 957432567..fcf90096f 100644
--- a/docs/content/extras/menus.md
+++ b/docs/content/extras/menus.md
@@ -96,10 +96,12 @@ Here’s an example `config.toml`:
pre = "<i class='fa fa-heart'></i>"
weight = -110
identifier = "about"
+ url = "/about/"
[[menu.main]]
name = "getting started"
pre = "<i class='fa fa-road'></i>"
weight = -100
+ url = "/getting-started/"
And the equivalent example `config.yaml`:
@@ -110,11 +112,16 @@ And the equivalent example `config.yaml`:
Pre: "<i class='fa fa-heart'></i>"
Weight: -110
Identifier: "about"
+ Url: "/about/"
- Name: "getting started"
Pre: "<i class='fa fa-road'></i>"
Weight: -100
+ Url: "/getting-started/"
---
+
+**NOTE:** The urls must be relative to the context root. If the `BaseUrl` is `http://example.com/mysite/`, then the urls in the menu must not include the context root `mysite`.
+
## Nesting
All nesting of content is done via the `parent` field.