Skip to content

Commit

Permalink
improve separator accessibility + tag copy-pasteability
Browse files Browse the repository at this point in the history
  • Loading branch information
welpo committed Nov 9, 2024
1 parent 59253df commit bcda881
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions sass/parts/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ header {
list-style-type: none;
}

.tag {
margin-inline-end: 0;
}

.separator {
margin-inline-end: 0.2rem;
user-select: none;
Expand Down
6 changes: 3 additions & 3 deletions templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ <h1 class="article-title">
{%- set previous_visible = true -%}
{% endif %}

{%- set separator_with_class = "<span class='separator'>" ~ separator ~ "</span>"-%}
{%- set separator_with_class = "<span class='separator' aria-hidden='true'>" ~ separator ~ "</span>"-%}

{#- Date -#}
{% if page.date and macros_settings::evaluate_setting_priority(setting="show_date", page=page, default_global_value=true) == "true" %}
Expand All @@ -157,9 +157,9 @@ <h1 class="article-title">

{#- Tags -#}
{%- if page.taxonomies and page.taxonomies.tags -%}
<li>{%- if previous_visible -%}{{ separator_with_class | safe }}{%- endif -%}{{- macros_translate::translate(key="tags", default="tags", language_strings=language_strings) | capitalize -}}:&nbsp;</li>
<li class="tag">{%- if previous_visible -%}{{ separator_with_class | safe }}{%- endif -%}{{- macros_translate::translate(key="tags", default="tags", language_strings=language_strings) | capitalize -}}:&nbsp;</li>
{%- for tag in page.taxonomies.tags -%}
<li><a href="{{ get_taxonomy_url(kind='tags', name=tag, lang=lang) | safe }}">{{ tag }}</a>
<li class="tag"><a href="{{ get_taxonomy_url(kind='tags', name=tag, lang=lang) | safe }}">{{ tag }}</a>
{%- if not loop.last -%}
,&nbsp;
{%- endif -%}
Expand Down

0 comments on commit bcda881

Please sign in to comment.