Fix space in alt and style tags

This commit is contained in:
2021-11-10 20:17:42 +01:00
parent ea4c2dc200
commit fba2bd8805
8 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
{{- $img := resources.Get .path }}
{{- $img = $img.Resize (printf "%dx%d webp" $img.Width $img.Height) }}
<img src="{{ $img.Permalink }}" alt="{{ .alt | default " " }}" width="{{ .width | default $img.Width }}"
<img src="{{ $img.Permalink }}" alt="{{ .alt | default "" }}" width="{{ .width | default $img.Width }}"
height="{{ .height | default $img.Height }}" {{- if .class}}class="{{ .class }}" {{end}}
{{- if .style}}style="{{ .style | safeCSS | default " " }}" {{end}} />
{{- if .style}}style="{{ .style | safeCSS }}" {{end}} />
@@ -53,7 +53,7 @@
{{- $img := resources.Get .Params.cover }}
{{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }}
<meta name="twitter:image" content="{{ $img.Permalink }}" />
<meta name="twitter:image:alt" content="{{ .Params.title | plainify | default " " }}" />
<meta name="twitter:image:alt" content="{{ .Params.title | plainify }}" />
{{- end }}
<meta name="twitter:title" content="{{ .Title }}" />
<meta name="twitter:description"