From 49ec3b5a01874d6cc67e95a7bd1333400c93232b Mon Sep 17 00:00:00 2001 From: Tim Cappalli Date: Sun, 11 May 2025 14:57:19 -0400 Subject: [PATCH 1/2] showCategoryOnly config --- layouts/partials/article-meta/basic.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/layouts/partials/article-meta/basic.html b/layouts/partials/article-meta/basic.html index 6bf60596..307ca0a3 100644 --- a/layouts/partials/article-meta/basic.html +++ b/layouts/partials/article-meta/basic.html @@ -96,4 +96,15 @@ {{ end }} +{{/* Output only category */}} +{{ if .Params.showCategoryOnly | default (.Site.Params.article.showCategoryOnly | default false) }} +
+ {{ range (.GetTerms "categories") }} + + {{ partial "badge.html" .LinkTitle }} + +{{ end }} +
+{{ end }} + {{ end }} From 5a9e92d81b8f893f7dfc939f4fa7d7562042b450 Mon Sep 17 00:00:00 2001 From: Tim Cappalli Date: Sun, 11 May 2025 14:58:20 -0400 Subject: [PATCH 2/2] Add showCategoryOnly to params --- config/_default/params.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/_default/params.toml b/config/_default/params.toml index 0803aea5..ddf32fa8 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -77,7 +77,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"] @@ -164,4 +165,4 @@ forgejoDefaultServer = "https://v8.next.forgejo.org" [rssnext] # feedId = "" - # userId = "" \ No newline at end of file + # userId = ""