In the current demo, when navigating to related posts, the following tags are displayed:
However, when you switch to /fr and then click a post, for example on this page, no tags are listed:
The reason is that in themes/PaperMod/layouts/_default/single.html, we only allow .Language.Params.Taxonomies.tag as defined in config.yml. I think it would be better to allow dynamic tags for different language pages.
For example, in my current setup, I switched to the following code:
<footer class="post-footer">
{{- if eq .Lang "en" }}
{{- if .Params.tags }}
<ul class="post-tags">
{{- range (.GetTerms "tags") }}
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
{{- end }}
</ul>
{{- end }}
{{- else if eq .Lang "cn" }}
{{- with .Params.cntags }}
<ul class="post-tags">
{{- range . }}
<li><a href="/cn/cntags/{{ . | urlize }}">{{ . }}</a></li>
{{- end }}
</ul>
{{- end }}
{{- end }}
{{- if (.Param "ShowPostNavLinks") }}
{{- partial "post_nav_links.html" . }}
{{- end }}
{{- if (and site.Params.ShowShareButtons (ne .Params.disableShare true)) }}
{{- partial "share_icons.html" . -}}
{{- end }}
</footer>
This code allows me to display tags under both English posts and Chinese posts.
Expected Behavior
Tags should appear under the post for the selected language.
Actual Behavior
Tags are not displayed for posts in non-default languages.
Code of Conduct
[X] I agree to follow this project's Code of Conduct
What you'd like to propose?
In the current demo, when navigating to related posts, the following tags are displayed:
However, when you switch to
/fr
and then click a post, for example on this page, no tags are listed:The reason is that in
themes/PaperMod/layouts/_default/single.html
, we only allow.Language.Params.Taxonomies.tag
as defined inconfig.yml
. I think it would be better to allow dynamic tags for different language pages.For example, in my current setup, I switched to the following code:
This code allows me to display tags under both English posts and Chinese posts.
Expected Behavior
Tags should appear under the post for the selected language.
Actual Behavior
Tags are not displayed for posts in non-default languages.
Code of Conduct