mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
🚸 UX: Use anchor tags in article-meta/basic.html
- This removes an inline event handler - This also adds an aria-label Using javascript instead of just using <a></a> is bad practice regarding accessibility and automated processing of web pages. Even the browser doesn't show a hint if hovering badges when using the old implementation. This in my opinion is a good way to replace inline event handlers in that code.
This commit is contained in:
@@ -82,9 +82,7 @@
|
||||
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
|
||||
{{ range $i, $a := $context.GetTerms $taxonomy }}
|
||||
{{ if not (eq $i 0) }}, {{ end }}
|
||||
<div class="cursor-pointer" onclick="window.open({{ $a.RelPermalink }},'_self');return false;">
|
||||
{{ $a.LinkTitle }}
|
||||
</div>
|
||||
<a href="{{ $a.RelPermalink }}" class="relative">{{ $a.LinkTitle }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -99,11 +97,7 @@
|
||||
{{ if and (not (eq $taxonomy "authors")) (not (eq $taxonomy "series")) }}
|
||||
{{ if (gt (len ($context.GetTerms $taxonomy)) 0) }}
|
||||
{{ range $context.GetTerms $taxonomy }}
|
||||
<span
|
||||
class="mr-2 mt-[0.5rem]"
|
||||
onclick="window.open({{ .RelPermalink }},'_self');return false;">
|
||||
{{ partial "badge.html" .LinkTitle }}
|
||||
</span>
|
||||
<a class="mr-2 mt-[0.5rem] relative" href="{{ .RelPermalink }}">{{ partial "badge.html" .LinkTitle }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -115,9 +109,7 @@
|
||||
{{ if .Params.showCategoryOnly | default (.Site.Params.article.showCategoryOnly | default false) }}
|
||||
<div class="flex flex-row flex-wrap items-center">
|
||||
{{ range (.GetTerms "categories") }}
|
||||
<span class="mr-2 mt-[0.5rem]" onclick="window.open({{ .RelPermalink }},'_self');return false;">
|
||||
{{ partial "badge.html" .LinkTitle }}
|
||||
</span>
|
||||
<a class="mr-2 mt-[0.5rem] relative" href="{{ .RelPermalink }}">{{ partial "badge.html" .LinkTitle }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user