mirror of https://github.com/luizdepra/hugo-coder.git

Simon Hollingshead
11.16.2022 688fc5512318a8128a6999b387896a2a824ae578
Add text to the link for screenreaders. (#713)

Also add a tooltip at the same time.
2 files modified
6 ■■■■■ changed files
layouts/_default/_markup/render-heading.html 3 ●●●● patch | view | raw | blame | history
layouts/partials/posts/series.html 3 ●●●● patch | view | raw | blame | history
layouts/_default/_markup/render-heading.html
@@ -1,6 +1,7 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
  {{ .Text | safeHTML }}
  <a class="heading-link" href="#{{ .Anchor | safeURL }}">
    <i class="fa fa-link" aria-hidden="true"></i>
    <i class="fa fa-link" aria-hidden="true" title="{{ i18n "link_to_heading" | default "Link to heading" }}"></i>
    <span class="sr-only">{{ i18n "link_to_heading" | default "Link to heading" }}</span>
  </a>
</h{{ .Level }}>
layouts/partials/posts/series.html
@@ -8,7 +8,8 @@
      <h3 id="{{ i18n "see_also" | default "See also in" | anchorize }}-{{ anchorize . | safeURL }}">
        {{ i18n "see_also" | default "See also in" }} {{ . }}
        <a class="heading-link" href="#{{ i18n "see_also" | default "See also in" | anchorize }}-{{ anchorize . | safeURL }}">
          <i class="fa fa-link" aria-hidden="true"></i>
          <i class="fa fa-link" aria-hidden="true" title="{{ i18n "link_to_heading" | default "Link to heading" }}"></i>
          <span class="sr-only">{{ i18n "link_to_heading" | default "Link to heading" }}</span>
        </a>
      </h3>
      <nav>