Skip to content

Commit

Permalink
change level category look (#610)
Browse files Browse the repository at this point in the history
* change level category look

* Change to names, remove diataxis.

---------

Co-authored-by: Thomas Wiecki <[email protected]>
  • Loading branch information
OriolAbril and twiecki authored Nov 28, 2023
1 parent e2504aa commit 68d9cde
Showing 1 changed file with 7 additions and 25 deletions.
32 changes: 7 additions & 25 deletions _templates/postcard_categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
{% endif %}
{%- endmacro -%}


{%- macro category_item(name, icon, active) -%}
{%- macro category_item(name, active) -%}
<a href="{{ pathtocategory(name) }}" class="{{ setcolorclass(active) }}" title="{{ name }}">
<span class="fas {{ icon }}"></span>
<label class="sr-only">{{ name }}</label>
</a>
<b>{{ name }}</b>
</a>
{%- endmacro -%}

<!-- {% set post = "" %} -->
Expand All @@ -33,32 +31,16 @@ <h3>
{% set b_bool = "beginner" in post.category|map('string') %}
{% set a_bool = "advanced" in post.category|map('string') %}
<div class="container">
<div class="row">
<div class="row sd-fs-6">
<div class="col">
{{ category_item("beginner", "fa-crow", b_bool) }}
{{ category_item("beginner", b_bool) }}
</div>
<div class="col">
{{ category_item("intermediate", "fa-dove", i_bool) }}
{{ category_item("intermediate", i_bool) }}
</div>
<div class="col">
{{ category_item("advanced", "fa-dragon", a_bool) }}
{{ category_item("advanced", a_bool) }}
</div>
</div>
</div>

<!-- diataxis type categories -->
<div class="container sd-fs-6 sd-font-weight-bold">
<div class="row border-top border-bottom">
{% set t_bool = "tutorial" in post.category|map('string') %}
<div class="col"><a class="{{ setcolorclass(t_bool) }}" href="{{ pathtocategory('tutorial') }}">Tutorial</a></div>
{% set h_bool = "how-to" in post.category|map('string') %}
<div class="col"><a class="{{ setcolorclass(h_bool) }}" href="{{ pathtocategory('how-to') }}">How-to</a></div>
<div class="w-100"></div>
{% set e_bool = "explanation" in post.category|map('string') %}
<div class="col"><a class="{{ setcolorclass(e_bool) }}" href="{{ pathtocategory('explanation') }}">Explanation</a></div>
{% set r_bool = "reference" in post.category|map('string') %}
<div class="col"><a class="{{ setcolorclass(r_bool) }}" href="{{ pathtocategory('reference') }}">Reference</a></div>
</div>
</div>

</div>

0 comments on commit 68d9cde

Please sign in to comment.