From aa7de60ef99ca2e05c760f3f1bd0be89593404eb Mon Sep 17 00:00:00 2001 From: Didier Roche Date: Mon, 19 Dec 2016 19:10:31 +0100 Subject: Fix tags and categories links when reading a post MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tags and categories links in article header were relative to current page, which works well when people are on the homepage. However, when you are in a blog post (/post/<…>), then, it's appended to it and ends up as /post/<…>/tags/foo for instance, leading to a 404. Add a / in front of links and be always relative to the baseurl of the website. --- layouts/partials/article_header.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'layouts') diff --git a/layouts/partials/article_header.html b/layouts/partials/article_header.html index b70d5a3..e7acf9e 100644 --- a/layouts/partials/article_header.html +++ b/layouts/partials/article_header.html @@ -23,8 +23,8 @@
{{ range $k, $v := .Params.categories }} - {{ $url := printf "%s/%s" "categories" (. | urlize | lower) }} - + {{ $url := printf "categories/%s" (. | urlize | lower) }} + {{ if lt $k (sub $categoriesLen 1) }}·{{ end }} {{ end }}
@@ -37,8 +37,8 @@
{{ range $k, $v := .Params.tags }} - {{ $url := printf "%s/%s" "tags" (. | urlize | lower) }} - + {{ $url := printf "tags/%s" (. | urlize | lower) }} + {{ if lt $k (sub $tagsLen 1) }}·{{ end }} {{ end }}
-- cgit v1.2.3