diff --git a/macros.njk b/macros.njk index e63fa72..c421f7a 100644 --- a/macros.njk +++ b/macros.njk @@ -13,15 +13,23 @@ {%endset%} - {% set sortingOnThisParam = id === sortBy %} {% set linkParams = "?sortBy=" + id + "&sortDirection=asc" %} +{%set ariaSort = "none"%} {%if sortingOnThisParam and sortDirection === "asc"%} {% set linkParams = "?sortBy=" + id + "&sortDirection=desc" %} + {%set ariaSort = "ascending"%} +{%endif%} + +{%if sortingOnThisParam and sortDirection === "desc"%} + {% set linkParams = "?sortBy=" + id + "&sortDirection=asc" %} + {%set ariaSort = "descending"%} {%endif%} - {{name}} + + + {{name}} {% if sortDirection === "asc" and sortingOnThisParam %}