Skip to content

Commit

Permalink
feat(emulsif-443): reduce redundant usage of current page indication
Browse files Browse the repository at this point in the history
  • Loading branch information
Mari Nez committed Jan 17, 2025
1 parent e2dd9b2 commit 97901e2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/components/navigation/pager/pager.twig
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,8 @@
{% set current_class = current == key ? 'is-active' : '' %}
{% set aria_current = current == key ? 'aria-current="page"' : '' %}
<li {{ bem('item', [], pager__base_class, [current_class]) }}>
{% set title = current == key ? 'Current page'|t : 'Go to page @key'|t({'@key': key}) %}
<a {{ bem('link', [], pager__base_class, [current_class]) }} href="{{ item.href }}" title="{{ title }}"{{ item.attributes|without('href', 'title') }} {{ aria_current }}>
<span {{ bem('visually-hidden') }}>
{{ current == key ? 'Current page'|t : 'Page '|t }}
</span>
{% set title = current != key ? 'title="Go to page @key"'|t({'@key': key}) : '' %}
<a {{ bem('link', [], pager__base_class, [current_class]) }} href="{{ item.href }}" {{ title }} {{ item.attributes|without('href', 'title') }} {{ aria_current }}>
{{- key -}}
</a>
</li>
Expand Down

0 comments on commit 97901e2

Please sign in to comment.