Add aria labels to share buttons

This commit is contained in:
BBaoVanC 2023-01-26 16:36:03 -06:00
parent 0744af717d
commit ebaa1de00b
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
3 changed files with 42 additions and 0 deletions

View File

@ -129,3 +129,21 @@ aria_langpicker_list:
aria_table_of_contents: aria_table_of_contents:
other: "table of contents" other: "table of contents"
aria_share_twitter:
other: "share to twitter button"
aria_share_facebook:
other: "share to facebook button"
aria_share_linkedin:
other: "share to linkedin button"
aria_share_reddit:
other: "share to reddit button"
aria_share_telegram:
other: "share to telegram button"
aria_share_print:
other: "print article button"

View File

@ -129,3 +129,21 @@ newer_post:
# aria_table_of_contents: # aria_table_of_contents:
# other: "table of contents" # other: "table of contents"
# aria_share_twitter:
# other: "share to twitter button"
# aria_share_facebook:
# other: "share to facebook button"
# aria_share_linkedin:
# other: "share to linkedin button"
# aria_share_reddit:
# other: "share to reddit button"
# aria_share_telegram:
# other: "share to telegram button"
# aria_share_print:
# other: "print article button"

View File

@ -3,6 +3,7 @@
<a class="twitter-share" <a class="twitter-share"
target="_blank" target="_blank"
rel="noopener" rel="noopener"
aria-label="{{ i18n "aria_share_twitter" }}"
onclick="share_event('Twitter');" onclick="share_event('Twitter');"
href="https://twitter.com/intent/tweet?url={{ .Permalink }}&text={{ .Title }}&via=bbaovanc"> href="https://twitter.com/intent/tweet?url={{ .Permalink }}&text={{ .Title }}&via=bbaovanc">
{{- partial "icon.html" "twitter" -}} {{- partial "icon.html" "twitter" -}}
@ -13,6 +14,7 @@
<a class="facebook-share" <a class="facebook-share"
target="_blank" target="_blank"
rel="noopener" rel="noopener"
aria-label="{{ i18n "aria_share_facebook" }}"
onclick="share_event('Facebook');" onclick="share_event('Facebook');"
href="https://www.facebook.com/sharer.php?u={{ .Permalink }}"> href="https://www.facebook.com/sharer.php?u={{ .Permalink }}">
{{- partial "icon.html" "facebook" -}} {{- partial "icon.html" "facebook" -}}
@ -23,6 +25,7 @@
<a class="linkedin-share" <a class="linkedin-share"
target="_blank" target="_blank"
rel="noopener" rel="noopener"
aria-label="{{ i18n "aria_share_linkedin" }}"
onclick="share_event('LinkedIn');" onclick="share_event('LinkedIn');"
href="https://www.linkedin.com/sharing/share-offsite/?url={{ .Permalink }}"> href="https://www.linkedin.com/sharing/share-offsite/?url={{ .Permalink }}">
{{- partial "icon.html" "linkedin" -}} {{- partial "icon.html" "linkedin" -}}
@ -33,6 +36,7 @@
<a class="reddit-share" <a class="reddit-share"
target="_blank" target="_blank"
rel="noopener" rel="noopener"
aria-label="{{ i18n "aria_share_reddit" }}"
onclick="share_event('Reddit');" onclick="share_event('Reddit');"
href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}"> href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}">
{{- partial "icon.html" "reddit" -}} {{- partial "icon.html" "reddit" -}}
@ -46,6 +50,7 @@
<a class="telegram-share" <a class="telegram-share"
target="_blank" target="_blank"
rel="noopener" rel="noopener"
aria-label="{{ i18n "aria_share_telegram" }}"
onclick="share_event('Telegram');" onclick="share_event('Telegram');"
href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}"> href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}">
{{- partial "icon.html" "telegram" -}} {{- partial "icon.html" "telegram" -}}
@ -55,6 +60,7 @@
{{ if .Site.Params.shareButtons.print }} {{ if .Site.Params.shareButtons.print }}
<a class="print-share" <a class="print-share"
aria-label="{{ i18n "aria_share_print" }}"
href="javascript:void(0)" href="javascript:void(0)"
onclick="window.print(); share_event('Print');"> onclick="window.print(); share_event('Print');">
{{- partial "icon.html" "printer" -}} {{- partial "icon.html" "printer" -}}