diff options
author | Tino Michael <tino.michael.87@gmail.com> | 2021-11-07 18:40:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-07 18:40:30 +0300 |
commit | f51ed131b9ee83b7b383e4ffecbe220d0f664518 (patch) | |
tree | 81e7026d95d7982c7bd033540e0a5ea9fd310021 | |
parent | cd18522f05b2948f514ad9bb7be9f7c5ed3596e2 (diff) |
use relLangURL (#335)
for author, tags and categories
-rw-r--r-- | layouts/_default/list.html | 2 | ||||
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/partials/recent_posts.html | 2 | ||||
-rw-r--r-- | layouts/partials/widgets/categories.html | 2 | ||||
-rw-r--r-- | layouts/partials/widgets/tags.html | 4 |
5 files changed, 6 insertions, 6 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 8a355f2..fd6ec2f 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -41,7 +41,7 @@ <div class="clearfix"> <p class="author-category"> {{ if isset .Params "authors" }} - {{ i18n "authorBy" }} {{ range $index, $author := .Params.authors }}{{ if $index }}, {{ end }}<a href="{{ (printf "%s/%s" ("authors" | relURL) ($author | urlize)) }}">{{ $author }}</a>{{ end }} + {{ i18n "authorBy" }} {{ range $index, $author := .Params.authors }}{{ if $index }}, {{ end }}<a href="{{ (printf "%s/%s" ("authors" | relLangURL) ($author | urlize)) }}">{{ $author }}</a>{{ end }} {{ end }} {{ if isset .Params "categories" }} {{ if gt (len .Params.categories) 0 }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 15956c5..7f32435 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -26,7 +26,7 @@ {{ if or .Params.author .Params.date }} <p class="text-muted text-uppercase mb-small text-right"> {{ if isset .Params "authors" }} - {{ i18n "authorBy" }} {{ range $index, $author := .Params.authors }}{{ if $index }}, {{ end }}<a href="{{ (printf "%s/%s" ("authors" | relURL) ($author | urlize)) }}">{{ $author }}</a>{{ end }} + {{ i18n "authorBy" }} {{ range $index, $author := .Params.authors }}{{ if $index }}, {{ end }}<a href="{{ (printf "%s/%s" ("authors" | relLangURL) ($author | urlize)) }}">{{ $author }}</a>{{ end }} {{ end }} {{ if and .Params.author .Params.date }} | {{ end }} {{ if .Params.date }} diff --git a/layouts/partials/recent_posts.html b/layouts/partials/recent_posts.html index eb6f2f5..5add1e8 100644 --- a/layouts/partials/recent_posts.html +++ b/layouts/partials/recent_posts.html @@ -39,7 +39,7 @@ <h4><a href="{{ .Permalink }}">{{ .Title }}</a></h4> <p class="author-category"> {{ if isset .Params "authors" }} - {{ i18n "authorBy" }} {{ range $index, $author := .Params.authors }}{{ if $index }}, {{ end }}<a href="{{ (printf "%s/%s" ("authors" | relURL) ($author | urlize)) }}">{{ $author }}</a>{{ end }} + {{ i18n "authorBy" }} {{ range $index, $author := .Params.authors }}{{ if $index }}, {{ end }}<a href="{{ (printf "%s/%s" ("authors" | relLangURL) ($author | urlize)) }}">{{ $author }}</a>{{ end }} {{ end }} {{ if .Params.date }} {{ $createdAt := .Date.Format .Site.Params.date_format }} diff --git a/layouts/partials/widgets/categories.html b/layouts/partials/widgets/categories.html index d40c134..0dfc929 100644 --- a/layouts/partials/widgets/categories.html +++ b/layouts/partials/widgets/categories.html @@ -12,7 +12,7 @@ {{ $current := . }} {{ range $name, $items := .Site.Taxonomies.categories }} <li{{ if eq $current.RelPermalink ($name | urlize | lower | printf "/categories/%s/") }} class="active"{{ end }}> - <a href="{{ "categories/" | relURL }}{{ $name | urlize | lower }}">{{ $name | upper }} ({{ len $items }})</a> + <a href="{{ "categories/" | relLangURL }}{{ $name | urlize | lower }}">{{ $name | upper }} ({{ len $items }})</a> </li> {{ end }} </ul> diff --git a/layouts/partials/widgets/tags.html b/layouts/partials/widgets/tags.html index d6aa383..10f425e 100644 --- a/layouts/partials/widgets/tags.html +++ b/layouts/partials/widgets/tags.html @@ -11,8 +11,8 @@ <ul class="tag-cloud"> {{ $current := . }} {{ range $name, $items := .Site.Taxonomies.tags }} - <li{{ if eq $current.RelPermalink ($name | urlize | lower | printf "/tags/%s/") }} class="active"{{ end }}> - <a href="{{ "tags/" | relURL }}{{ $name | urlize | lower }}"><i class="fas fa-tags"></i> {{ $name }}</a> + <li {{ if eq $current.RelPermalink (printf "%s/%s/" ("tags" | relLangURL) ($name | urlize | lower)) }}class="active"{{ end }}> + <a href="{{ "tags/" | relLangURL }}{{ $name | urlize | lower }}"><i class="fas fa-tags"></i> {{ $name }}</a> </li> {{ end }} </ul> |