From 2451b194dc022b9a2b6ad23c3ec819d3ddb7e1cb Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 13 Sep 2020 10:14:17 +0200 Subject: [PATCH] refactor: use relLangURL to build relative links For better i18n support Fixes archive page path Remove tag cloud term exclusion closes https://github.com/CaiJimmy/hugo-theme-stack/issues/8 --- layouts/partials/article/components/details.html | 4 ++-- layouts/partials/article/components/footer.html | 2 +- layouts/partials/widget/archive.html | 4 ++-- layouts/partials/widget/tag-cloud.html | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/layouts/partials/article/components/details.html b/layouts/partials/article/components/details.html index 0a8f777..1b776be 100644 --- a/layouts/partials/article/components/details.html +++ b/layouts/partials/article/components/details.html @@ -7,10 +7,10 @@ {{ if and $image.exists $image.resource }} {{- $imageRaw := $image.resource | resources.Fingerprint "md5" -}} {{- $20x := $imageRaw.Fill "20x20 smart" -}} - {{ . | humanize }} {{ else }} - {{ . | humanize }} + {{ . | humanize }} {{ end }} {{ end }} diff --git a/layouts/partials/article/components/footer.html b/layouts/partials/article/components/footer.html index 9787f8f..102bc4a 100644 --- a/layouts/partials/article/components/footer.html +++ b/layouts/partials/article/components/footer.html @@ -2,7 +2,7 @@ {{ with $tags := .Params.Tags }}
{{ range $tags }} - {{ . | humanize }} + {{ . | humanize }} {{ end }}
{{ end }} diff --git a/layouts/partials/widget/archive.html b/layouts/partials/widget/archive.html index 22b3236..1dae730 100644 --- a/layouts/partials/widget/archive.html +++ b/layouts/partials/widget/archive.html @@ -12,7 +12,7 @@ {{ range first .Site.Params.widgets.archive.limit ($archive) }} {{ $id := lower (replace .Key " " "-") }}
- + {{ .Key }} {{ len .Pages }} @@ -21,7 +21,7 @@ {{ if gt (len $archive) .Site.Params.widgets.archive.limit }} diff --git a/layouts/partials/widget/tag-cloud.html b/layouts/partials/widget/tag-cloud.html index fbc4778..1fa8efe 100644 --- a/layouts/partials/widget/tag-cloud.html +++ b/layouts/partials/widget/tag-cloud.html @@ -1,5 +1,4 @@ {{ $tags := .Site.Taxonomies.tags.ByCount }} -{{ $v2 := where $tags "Term" "not in" (slice "hugo" "tag" "rss") }}
@@ -8,8 +7,8 @@

{{ T "widgetTagCloudTitle" }}

- {{ range first .Site.Params.widgets.tagCloud.limit $v2 }} - + {{ range first .Site.Params.widgets.tagCloud.limit $tags }} + {{ .Term | humanize }} {{ end }}