Fix space in alt and style tags

alternate-navbar
Maik de Kruif 3 years ago
parent ea4c2dc200
commit fba2bd8805
Signed by: maik
GPG Key ID: 44A55AD1F0673FA6
  1. 4
      themes/maik-blog/layouts/partials/image.html
  2. 2
      themes/maik-blog/layouts/partials/meta-tags.html
  3. 2
      themes/maik-blog/layouts/portfolio/list.html
  4. 2
      themes/maik-blog/layouts/portfolio/single.html
  5. 2
      themes/maik-blog/layouts/posts/single.html
  6. 2
      themes/maik-blog/layouts/shortcodes/figure.html
  7. 2
      themes/maik-blog/layouts/shortcodes/image.html
  8. 2
      themes/maik-blog/layouts/writeups/single.html

@ -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"

@ -75,7 +75,7 @@
</div>
{{- if .Params.Cover }}
<figure class="portfolio-cover">
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ")) }}
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify)) }}
{{- if .Params.CoverCaption }}
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>

@ -35,7 +35,7 @@
{{- end }}
{{- if .Params.Cover }}
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ") "class" "portfolio-cover") }}
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify) "class" "portfolio-cover") }}
{{- end }}
<div class="portfolio-content">

@ -38,7 +38,7 @@
{{- end }}
{{- if .Params.Cover }}
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ") "class" "post-cover") }}
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify) "class" "post-cover") }}
{{- end }}
<div class="post-content">

@ -9,7 +9,7 @@
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" {{- end -}}
width="{{ .Get "width" | default $img.Width }}" height="{{ .Get "height" | default $img.Height }}" />
{{- else }}
{{- partial "image.html" (dict "path" (.Get "src") "alt" (or (.Get "alt") (.Get "caption" | markdownify | plainify) | default " ") "width" (.Get "width") "height" (.Get "height")) }}
{{- partial "image.html" (dict "path" (.Get "src") "alt" (or (.Get "alt") (.Get "caption" | markdownify | plainify)) "width" (.Get "width") "height" (.Get "height")) }}
{{- end }}
{{- if .Get "link" }}</a>{{ end -}}
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}

@ -1,3 +1,3 @@
{{- if .Get "src" }}
{{- partial "image.html" (dict "path" (.Get "src") "alt" (.Get "alt" | plainify | default " ") "style" (.Get "style" | safeCSS | default " ") )}}
{{- partial "image.html" (dict "path" (.Get "src") "alt" (.Get "alt" | plainify) "style" (.Get "style" | safeCSS) )}}
{{- end }}

@ -38,7 +38,7 @@
{{- end }}
{{- if .Params.Cover }}
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ") "class" "post-cover") }}
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify) "class" "post-cover") }}
{{- end }}
<div class="post-content">

Loading…
Cancel
Save