From ce7460686e2a93ca5942e0976728891c400fc598 Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Fri, 19 Aug 2022 18:19:11 +0200 Subject: [PATCH] =?UTF-8?q?Seznam=20tag=C5=AF=20z=20kategorie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sass/_tags.scss | 25 +++++++++++++++---------- templates/kategorie/single.html | 3 +++ templates/macros.html | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/sass/_tags.scss b/sass/_tags.scss index e664672..142101b 100644 --- a/sass/_tags.scss +++ b/sass/_tags.scss @@ -1,18 +1,23 @@ .taglist .tag { - margin-right:$tag-margin-right; - padding:$tag-padding; - background:$tag-background; - color:$tag-color; - border-radius:$tag-border-radius; - border:1px solid #aaa; - font-size:$tag-font-size; - display:inline-block; + margin-right: $tag-margin-right; + background: $tag-background; + color: $tag-color; + border-radius: $tag-border-radius; + border: 1px solid #aaa; + font-size: $tag-font-size; + display: inline-block; a { - color:$tag-color; + display: block; + color: $tag-color; + white-space: nowrap; + padding: $tag-padding; &:hover { - color:lighten($anchor-hover-color,40); + color: $primary; } } } +.taglist.centering { + justify-content: center; +} diff --git a/templates/kategorie/single.html b/templates/kategorie/single.html index 86599fe..cbfc54c 100644 --- a/templates/kategorie/single.html +++ b/templates/kategorie/single.html @@ -3,6 +3,9 @@ {% block content %}

{{ term.name | capitalize() }}

+
+ {{ macro::tags_in_category() }} +

{% for page in term.pages %} diff --git a/templates/macros.html b/templates/macros.html index c977835..b25bb4f 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -39,6 +39,20 @@ {% endmacro subnav %} +{% macro tags_in_category() %} + {% set_global tags = [] %} + {% for page in term.pages %} + {% for tag in page.taxonomies.tagy %} + {% set_global tags = tags | concat(with=tag) %} + {% endfor %} + {% endfor %} + + {% set_global tags = tags | sort | unique %} + {% for tag in tags %} + {{ tag }} + {% endfor %} +{% endmacro tags_in_category %} + {% macro recipe_image() %} {% for asset in page.assets %} {% if asset is matching("[img.](jpg|png)$") %}