From f0eb58757317ad61eab6896501cbec758b27f0b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrkan=20Soykan?= Date: Tue, 10 Sep 2024 16:57:54 +0200 Subject: [PATCH] Fix conditional rendering of tag and category section (#2678) ### Overview This PR fixes an issue where unnecessary horizontal lines were displayed when there were no tags or categories present. The tag and category container is now conditionally rendered, ensuring it only appears when there are tags or categories to display. no tags meaning, in _config.yml ``` display_tags: [] display_categories: [] ``` ### Before and After The difference is illustrated in the images below: - **First Image (Fixed)**: Shows the correct behavior with no extra lines when tags or categories are absent. - **Second Image (Current)**: Demonstrates the issue with unwanted horizontal lines appearing when no tags or categories are present. ![image](https://github.com/user-attachments/assets/08becad5-9a34-4b6c-8a69-25206d9097da) ![image](https://github.com/user-attachments/assets/e36390cc-3104-4aa2-a047-a7fa8289e664) ### Impact This change improves the visual consistency and cleanliness of the theme by preventing unnecessary elements from being rendered, particularly in cases where there are no tags or categories defined. --- _pages/blog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_pages/blog.md b/_pages/blog.md index d11387f..784938b 100644 --- a/_pages/blog.md +++ b/_pages/blog.md @@ -29,7 +29,7 @@ pagination: {% endif %} -{% if site.display_tags or site.display_categories %} +{% if site.display_tags and site.display_tags.size > 0 or site.display_categories and site.display_categories.size > 0 %}