diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 1a7871fe..39cf7a4e 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -43,7 +43,7 @@ {{- $categories := slice -}} {{- range .Params.categories -}} {{- $category := partialCached "function/path.html" . . | printf "/categories/%v" | $.Site.GetPage -}} - {{- $categories = $categories | append (printf `%v %v` (replace $category.RelPermalink "#" "%23") (dict "Class" "fa-regular fa-folder fa-fw" | partial "plugin/icon.html") $category.Title) -}} + {{- $categories = $categories | append (printf `%v %v` (partial "function/escapeurl.html" $category.RelPermalink) (dict "Class" "fa-regular fa-folder fa-fw" | partial "plugin/icon.html") $category.Title) -}} {{- end -}} {{- with delimit $categories " " -}} @@ -70,7 +70,7 @@ {{- range $value := . -}} {{- $tag := partialCached "function/path.html" $value $value | printf "/tags/%v" | $.Site.GetPage -}} {{- with $tag -}} - {{ .Title }} + {{ .Title }} {{- end -}} {{- end -}} diff --git a/layouts/partials/function/urlquery.html b/layouts/partials/function/escapeurl.html similarity index 100% rename from layouts/partials/function/urlquery.html rename to layouts/partials/function/escapeurl.html diff --git a/layouts/partials/function/path.html b/layouts/partials/function/path.html index 4fade7db..8f4fe09f 100644 --- a/layouts/partials/function/path.html +++ b/layouts/partials/function/path.html @@ -1,4 +1,4 @@ {{- /* https://discourse.gohugo.io/t/how-decode-urls-in-hugo/7549/4 */ -}} -{{- $URL := partial "function/urlquery.html" . -}} +{{- $URL := partial "function/escapeurl.html" . -}} {{- $URL = $URL | urlize | urls.Parse -}} {{- return $URL.Path -}} diff --git a/layouts/partials/single/footer.html b/layouts/partials/single/footer.html index f9d5f879..18ac1857 100644 --- a/layouts/partials/single/footer.html +++ b/layouts/partials/single/footer.html @@ -63,7 +63,7 @@ {{- range $value := . -}} {{- $tag := partialCached "function/path.html" $value $value | printf "/tags/%v" | $.Site.GetPage -}} {{- with $tag -}} - {{ .Title }} + {{ .Title }} {{- end -}} {{- end -}} {{- end -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 6496253d..4edb017d 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -52,7 +52,7 @@ {{- $categories := slice -}} {{- range .Params.categories -}} {{- $category := partialCached "function/path.html" . . | printf "/categories/%v" | $.Site.GetPage -}} - {{- $categories = $categories | append (printf `%v %v` (replace $category.RelPermalink "#" "%23") (dict "Class" "fa-regular fa-folder fa-fw" | partial "plugin/icon.html") $category.Title) -}} + {{- $categories = $categories | append (printf `%v %v` (partial "function/escapeurl.html" $category.RelPermalink) (dict "Class" "fa-regular fa-folder fa-fw" | partial "plugin/icon.html") $category.Title) -}} {{- end -}} {{- with delimit $categories " " }} diff --git a/layouts/taxonomy/terms.html b/layouts/taxonomy/terms.html index 30d39109..82185ff0 100644 --- a/layouts/taxonomy/terms.html +++ b/layouts/taxonomy/terms.html @@ -24,7 +24,7 @@ - + {{ dict "Class" "fa-regular fa-folder fa-fw" | partial "plugin/icon.html" }} {{ .Page.Title }} {{- len $pages -}} @@ -36,7 +36,7 @@ {{- end -}} {{- if gt (len $pages) 5 -}} - {{ T "more" }} >> + {{ T "more" }} >> {{- end -}} @@ -57,11 +57,11 @@ {{- range $tags -}} {{- $grade := math.Min (math.Floor (div (sub .Count 1) $baseGrade)) 10 -}} {{- $fontSize := add $minFont (mul $grade $baseFont) -}} - {{ .Page.Title }} {{ .Count }} + {{ .Page.Title }} {{ .Count }} {{- end -}} {{- else -}} {{- range $.Site.Taxonomies.tags.ByCount -}} - {{ .Page.Title }} {{ .Count }} + {{ .Page.Title }} {{ .Count }} {{- end -}} {{- end -}}