FEATURE: Add category slug to body class on tag pages if it is part of a category (#10911)

FEATURE: Add category slug to body class on tag pages if it is part of a category (#10911)

This commit will add the category slug class to the body if the tag is a child of a category.

Currently, when visiting a tag topic list only the tag name is added to the body class.

diff --git a/app/assets/javascripts/discourse/app/templates/tags/show.hbs b/app/assets/javascripts/discourse/app/templates/tags/show.hbs
index dded4a1..ca59b27 100644
--- a/app/assets/javascripts/discourse/app/templates/tags/show.hbs
+++ b/app/assets/javascripts/discourse/app/templates/tags/show.hbs
@@ -1,4 +1,4 @@
-{{#d-section tagName="" pageClass="tags" bodyClass=(concat "tag-" tag.id)}}
+{{#d-section tagName="" pageClass="tags" bodyClass=(concat "tag-" tag.id (if category.slug (concat " category-" category.slug)) "")}}
   <div class="container">
     {{discourse-banner user=currentUser banner=site.banner}}
   </div>

GitHub sha: e22370a8

This commit appears in #10911 which was approved by eviltrout. It was merged by jordanvidrine.