From 29ce095e7372a44794a94dd250a2ae7ad73de796 Mon Sep 17 00:00:00 2001 From: Minos Park Date: Mon, 1 Feb 2021 19:43:57 -0800 Subject: use hugo function urlize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In addition to converting spaces to hyphens, sanitize the string. No practical difference 🤷 xD https://gohugo.io/functions/urlize/ --- layouts/partials/list-taxonomy-terms.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/list-taxonomy-terms.html b/layouts/partials/list-taxonomy-terms.html index 9c813eb..f5eb67f 100644 --- a/layouts/partials/list-taxonomy-terms.html +++ b/layouts/partials/list-taxonomy-terms.html @@ -2,7 +2,7 @@ {{ range $term := .terms }} - {{ $term_path := lower (replace ($term) " " "-") }} + {{ $term_path := ($term | lower | urlize) }} {{ $term_page := site.GetPage (path.Join $.parent $term_path) }} {{ $url := $term_page.Permalink}} -- cgit v1.2.3 From dc7258472897eba3a615ae685976db4c70c6c6e6 Mon Sep 17 00:00:00 2001 From: Minos Park Date: Mon, 1 Feb 2021 19:47:09 -0800 Subject: use hugo function urlize to hypenate tags Previously tags with spaces will render without hyphens. This fixes it. --- layouts/section/archives.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/section/archives.html b/layouts/section/archives.html index 1a893c4..d7506fa 100644 --- a/layouts/section/archives.html +++ b/layouts/section/archives.html @@ -22,7 +22,7 @@ -- cgit v1.2.3 From 9f19255597d815de930efcdc253dabdb7c4ebe99 Mon Sep 17 00:00:00 2001 From: Minos Park Date: Mon, 1 Feb 2021 19:52:33 -0800 Subject: urlize syntax urlize also makes the string lowercase --- layouts/partials/list-taxonomy-terms.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/list-taxonomy-terms.html b/layouts/partials/list-taxonomy-terms.html index f5eb67f..aab2278 100644 --- a/layouts/partials/list-taxonomy-terms.html +++ b/layouts/partials/list-taxonomy-terms.html @@ -2,7 +2,7 @@ {{ range $term := .terms }} - {{ $term_path := ($term | lower | urlize) }} + {{ $term_path := (urlize $term) }} {{ $term_page := site.GetPage (path.Join $.parent $term_path) }} {{ $url := $term_page.Permalink}} -- cgit v1.2.3