Skip to content

Commit

Permalink
change old twig syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jphamslac committed Jan 27, 2024
1 parent b5130e6 commit 817be73
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
6 changes: 4 additions & 2 deletions source/03-components/event-date/event-date.twig
Expand Up @@ -14,13 +14,15 @@
</div>
{% endif %}

{% if is_multimonth %}{% apply spaceless %}
{% if is_multimonth %}
{% apply spaceless %}
<div>
</div>
<div>
<span class="c-event-date__month">{{ end_date.month }}</span>
{{- end_date.day -}}
</div>
{% endapply %}{% endif %}
{% endapply %}
{% endif %}
</div>
4 changes: 2 additions & 2 deletions source/03-components/form-item/_form-item-label.twig
Expand Up @@ -18,13 +18,13 @@

<label {{ add_attributes(attributes_to_add) }}>
{% if is_required %}
{%- spaceless %}
{%- apply spaceless %}
<span class="c-form-item__required-marker">
<span class="u-visually-hidden">
{{ 'This field is required.'|t }}
</span>
</span>
{% endspaceless -%}
{% endapply -%}
{% endif -%}

{{- title }}
Expand Down
8 changes: 4 additions & 4 deletions source/03-components/pager/pager--mini/pager--mini.twig
Expand Up @@ -14,7 +14,7 @@
{% set link_label = 'Go to previous page'|t %}
<li class="c-pager__item c-pager__item--previous">
<a class="c-pager__link c-pager__link--previous" href="{{ pager_items.previous.href }}" aria-label="{{ link_label }}" title="{{ link_label }}" rel="prev" {{ pager_items.previous.attributes|without('aria-label', 'href', 'rel', 'title') }}>
{%- spaceless %}
{%- apply spaceless %}
{% include '@components/icon/icon.twig' with {
'is_hidden': true,
'modifier_classes': 'c-icon--pager is-spaced-after',
Expand All @@ -23,7 +23,7 @@
<span class="u-visually-hidden">
{{ link_label }}
</span>
{% endspaceless -%}
{% endapply -%}
</a>
</li>
{% endif %}
Expand All @@ -41,7 +41,7 @@
{% set link_label = 'Go to next page'|t %}
<li class="c-pager__item c-pager__item--next">
<a class="c-pager__link c-pager__link--next" href="{{ pager_items.next.href }}" aria-label="{{ link_label }}" title="{{ link_label }}" rel="next" {{ pager_items.next.attributes|without('aria-label', 'href', 'rel', 'title') }}>
{%- spaceless %}
{%- apply spaceless %}
<span class="u-visually-hidden">
{{ link_label }}
</span>
Expand All @@ -50,7 +50,7 @@
'modifier_classes': 'c-icon--pager is-spaced-before',
'icon_name': 'angle-right',
} %}
{% endspaceless -%}
{% endapply -%}
</a>
</li>
{% endif %}
Expand Down
16 changes: 8 additions & 8 deletions source/03-components/pager/pager.twig
Expand Up @@ -14,7 +14,7 @@
<li class="c-pager__item c-pager__item--previous">
{% if pager_items.previous.href %}
<a class="c-pager__link c-pager__link--previous" href="{{ pager_items.previous.href }}" aria-label="{{ link_label }}" title="{{ link_label }}" rel="prev" {{ pager_items.previous.attributes|without('aria-label', 'href', 'rel', 'title') }}>
{%- spaceless %}
{%- apply spaceless %}
{% include '@components/icon/icon.twig' with {
'is_hidden': true,
'modifier_classes': 'c-icon--pager',
Expand All @@ -23,11 +23,11 @@
<span class="u-visually-hidden">
{{ link_label }}
</span>
{% endspaceless -%}
{% endapply -%}
</a>
{% else %}
<span class="c-pager__link c-pager__link--previous" {{ pager_items.previous.attributes|without('aria-label', 'href', 'rel', 'title') }}>
{%- spaceless %}
{%- apply spaceless %}
{% include '@components/icon/icon.twig' with {
'is_hidden': true,
'modifier_classes': 'c-icon--pager',
Expand All @@ -36,7 +36,7 @@
<span class="u-visually-hidden">
{{ link_label }}
</span>
{% endspaceless -%}
{% endapply -%}
</span>
{% endif %}
</li>
Expand Down Expand Up @@ -111,7 +111,7 @@
<li class="c-pager__item c-pager__item--next">
{% if pager_items.next.href %}
<a class="c-pager__link c-pager__link--next" href="{{ pager_items.next.href }}" aria-label="{{ link_label }}" title="{{ link_label }}" rel="next" {{ pager_items.next.attributes|without('aria-label', 'href', 'rel', 'title') }}>
{%- spaceless %}
{%- apply spaceless %}
<span class="u-visually-hidden">
{{ link_label }}
</span>
Expand All @@ -120,11 +120,11 @@
'modifier_classes': 'c-icon--pager',
'icon_name': 'angle-right',
} %}
{% endspaceless -%}
{% endapply -%}
</a>
{% else %}
<span class="c-pager__link c-pager__link--next" {{ pager_items.next.attributes|without('aria-label', 'href', 'rel', 'title') }}>
{%- spaceless %}
{%- apply spaceless %}
<span class="u-visually-hidden">
{{ link_label }}
</span>
Expand All @@ -133,7 +133,7 @@
'modifier_classes': 'c-icon--pager',
'icon_name': 'angle-right',
} %}
{% endspaceless -%}
{% endapply -%}
</span>
{% endif %}
</li>
Expand Down

0 comments on commit 817be73

Please sign in to comment.