Merge pull request #2133 from timcappalli/main

Feat: Adds ability show only the category instead of all tags
This commit is contained in:
Nuno Coração
2025-05-27 00:31:07 +01:00
committed by GitHub
2 changed files with 14 additions and 2 deletions

View File

@@ -78,7 +78,8 @@ forgejoDefaultServer = "https://v8.next.forgejo.org"
showTableOfContents = false
# showRelatedContent = false
# relatedContentLimit = 3
showTaxonomies = false
showTaxonomies = false # use showTaxonomies OR showCategoryOnly, not both
showCategoryOnly = false # use showTaxonomies OR showCategoryOnly, not both
showAuthorsBadges = false
showWordCount = true
# sharingLinks = [ "linkedin", "twitter", "bluesky", "mastodon", "reddit", "pinterest", "facebook", "email", "whatsapp", "telegram"]
@@ -165,4 +166,4 @@ forgejoDefaultServer = "https://v8.next.forgejo.org"
[rssnext]
# feedId = ""
# userId = ""
# userId = ""

View File

@@ -96,4 +96,15 @@
</div>
{{ end }}
{{/* Output only category */}}
{{ if .Params.showCategoryOnly | default (.Site.Params.article.showCategoryOnly | default false) }}
<div class="flex flex-row flex-wrap items-center">
{{ range (.GetTerms "categories") }}
<span style="margin-top:0.5rem" class="mr-2" onclick="window.open({{ .RelPermalink }},'_self');return false;">
{{ partial "badge.html" .LinkTitle }}
</span>
{{ end }}
</div>
{{ end }}
{{ end }}