Perf: add "alt" prop for theme images

This commit is contained in:
Cell
2022-04-27 23:32:12 +08:00
parent a02f3580e9
commit c9fea85e99
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
<a href="{{ .Site.Home.RelPermalink }}" title="{{ .Site.Title }}">
{{- with .Site.Params.header.title -}}
{{- with .logo -}}
{{- dict "Src" . "Class" "logo" | partial "plugin/image.html" -}}
{{- dict "Src" . "Class" "logo" "Alt" $.Site.Title | partial "plugin/image.html" -}}
{{- end -}}
{{- with .pre -}}
<span class="header-title-pre">{{ . | safeHTML }}</span>
+2 -2
View File
@@ -21,10 +21,10 @@
{{- $url = .RelPermalink -}}
{{- end -}}
<a href="{{ $url }}"{{ with .Title | default .Name }} title="{{ . }}"{{ end }}{{ if (urls.Parse $url).Host }} rel="noopener noreffer" target="_blank"{{ end }}>
{{- dict "Src" $avatar | partial "plugin/image.html" -}}
{{- dict "Src" $avatar "Alt" $.Site.Author.name | partial "plugin/image.html" -}}
</a>
{{- else -}}
{{- dict "Src" $avatar | partial "plugin/image.html" -}}
{{- dict "Src" $avatar "Alt" $.Site.Author.name | partial "plugin/image.html" -}}
{{- end -}}
</div>
{{- end -}}
+1 -1
View File
@@ -18,7 +18,7 @@
{{- $content := $author.name -}}
{{- $icon := dict "Class" "fas fa-user-circle" -}}
{{- if $avatar -}}
{{- $content = printf "%v&nbsp;%v" (dict "Src" $avatar "Class" "avatar" | partial "plugin/image.html") $author.name -}}
{{- $content = printf "%v&nbsp;%v" (dict "Src" $avatar "Class" "avatar" "Alt" $author.name | partial "plugin/image.html") $author.name -}}
{{- $icon = "" -}}
{{- end -}}
{{- if $author.link -}}