docs: Fix URLs in examples sites with path prefix - hugo - [fork] hugo port for 9front
HTML git clone git@git.drkhsh.at/hugo.git
DIR Log
DIR Files
DIR Refs
DIR Submodules
DIR README
DIR LICENSE
---
DIR commit de1ca477b8402ad195b121d60eddb2c3e4d2f506
DIR parent f914774f6bcb2416004101112c0f2dd1cd664176
HTML Author: Stephan Kulla <git.mail@kulla.me>
Date: Wed, 17 Aug 2016 10:30:55 +0200
docs: Fix URLs in examples sites with path prefix
When baseurl ist something like "http://example.com/hugo/" a link to
"/tags/..." does not work. Therefore I fixed the examples so that they
also work in cases where the website is not saved at the server's root.
See also https://discuss.gohugo.io/t/how-shall-i-link-a-taxonomy-page/3920
Diffstat:
M docs/content/taxonomies/displaying… | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
DIR diff --git a/docs/content/taxonomies/displaying.md b/docs/content/taxonomies/displaying.md
@@ -38,7 +38,7 @@ each content piece are located in the usual place
<ul id="tags">
{{ range .Params.tags }}
- <li><a href="tags/{{ . | urlize }}">{{ . }}</a> </li>
+ <li><a href="{{ "/tags/" | relURL }}{{ . | urlize }}">{{ . }}</a> </li>
{{ end }}
</ul>
@@ -52,7 +52,7 @@ To list such taxonomy use the following:
{{ if .Params.directors }}
<strong>Director{{ if gt (len .Params.directors) 1 }}s{{ end }}:</strong>
- {{ range $index, $director := .Params.directors }}{{ if gt $index 0 }}, {{ end }}<a href="directors/{{ . | urlize }}">{{ . }}</a>{{ end }}
+ {{ range $index, $director := .Params.directors }}{{ if gt $index 0 }}, {{ end }}<a href="{{ "/directors/" | relURL }}{{ . | urlize }}">{{ . }}</a>{{ end }}
{{ end }}
Alternatively, you may use the [delimit]({{< relref "templates/functions.md#delimit" >}})
@@ -110,7 +110,7 @@ The following example displays all tag keys:
<ul id="all-tags">
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
- <li><a href="/tags/{{ $name | urlize }}">{{ $name }}</a></li>
+ <li><a href="{{ "/tags/" | relURL }}{{ $name | urlize }}">{{ $name }}</a></li>
{{ end }}
</ul>
@@ -120,7 +120,7 @@ This example will list all taxonomies, each of their keys and all the content as
<section>
<ul>
{{ range $taxonomyname, $taxonomy := .Site.Taxonomies }}
- <li><a href="/{{ $taxonomyname | urlize }}">{{ $taxonomyname }}</a>
+ <li><a href="{{ "/" | relURL}}{{ $taxonomyname | urlize }}">{{ $taxonomyname }}</a>
<ul>
{{ range $key, $value := $taxonomy }}
<li> {{ $key }} </li>