-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display tags for each post #113
Comments
I join to this request. See an example: https://www.dbu9.site/post/2023-04-29-unveiling-the-exploitation-how-cyber-criminals-leverage-human-psychology-to-steal-crypto/ The screen shot: |
to list tags that are used in a article
[params]
# if true list article tags in the bottom of the page
listTags = true
# Tags
- id: Tags
translation: "Tags" NOTE: add the same lines for all the languages that your website support example: in # Tags
- id: Tags
translation: "labels"
and add this line after the line {{- partial "tags_list.html" . -}} the file should look like this: ...
{{ if (or .Site.Params.toc .Params.toc) }}
{{- partial "toc.html" . -}}
{{ end }}
{{ .Content }}
{{- partial "tags_list.html" . -}}
...
{{ if .Site.Params.listTags }}
<hr>
<p class="text-black dark:text-white text-2xl font-bold">{{ printf "Tags" | i18n "Tags" }}</p>
<div class="container p-6 mx-auto grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 lg:gap-8">
{{ range (.GetTerms "tags") }}
<div class="p-2">
<a href="{{ .Permalink }}">
<div class="my-2 text-xl font-semibold">{{ .LinkTitle }}</div>
</a>
</div>
{{ end }}
</div>
{{end}} |
This worked as a charm. But it does not replicate the functionality of BeautifulHugo theme which finds relevant posts (as I think these posts are with the same tag as the article) and puts them into See Also section. Do you have a recipe for that? Thanks! |
Hi, you can currently do that. I've added this shortcode to my single.html partial (it is in the /layouts/_default directory).
|
Thanks for this great theme!
Something to consider adding is displaying tags somewhere in each blog post. I often read a blog post somewhere, and find related posts by clicking the tags; just now, all the tags seem to be invisible on each post.
The text was updated successfully, but these errors were encountered: