diff --git a/themes/maik-blog/layouts/partials/image.html b/themes/maik-blog/layouts/partials/image.html index df51c0e..402c3d9 100644 --- a/themes/maik-blog/layouts/partials/image.html +++ b/themes/maik-blog/layouts/partials/image.html @@ -1,5 +1,5 @@ {{- $img := resources.Get .path }} {{- $img = $img.Resize (printf "%dx%d webp" $img.Width $img.Height) }} -{{ .alt | default \ No newline at end of file + {{- if .style}}style="{{ .style | safeCSS }}" {{end}} /> \ No newline at end of file diff --git a/themes/maik-blog/layouts/partials/meta-tags.html b/themes/maik-blog/layouts/partials/meta-tags.html index de3b1f7..e9da70c 100644 --- a/themes/maik-blog/layouts/partials/meta-tags.html +++ b/themes/maik-blog/layouts/partials/meta-tags.html @@ -53,7 +53,7 @@ {{- $img := resources.Get .Params.cover }} {{- $img = $img.Resize (printf "%dx%d png" $img.Width $img.Height) }} - + {{- end }} {{- if .Params.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 }}
{{ .Params.CoverCaption | markdownify }}
diff --git a/themes/maik-blog/layouts/portfolio/single.html b/themes/maik-blog/layouts/portfolio/single.html index b87be5a..a3ce200 100644 --- a/themes/maik-blog/layouts/portfolio/single.html +++ b/themes/maik-blog/layouts/portfolio/single.html @@ -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 }}
diff --git a/themes/maik-blog/layouts/posts/single.html b/themes/maik-blog/layouts/posts/single.html index be38198..da0abc6 100644 --- a/themes/maik-blog/layouts/posts/single.html +++ b/themes/maik-blog/layouts/posts/single.html @@ -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 }}
diff --git a/themes/maik-blog/layouts/shortcodes/figure.html b/themes/maik-blog/layouts/shortcodes/figure.html index 56754bf..36a7225 100644 --- a/themes/maik-blog/layouts/shortcodes/figure.html +++ b/themes/maik-blog/layouts/shortcodes/figure.html @@ -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" }}{{ end -}} {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} diff --git a/themes/maik-blog/layouts/shortcodes/image.html b/themes/maik-blog/layouts/shortcodes/image.html index 4dce1a9..6052787 100644 --- a/themes/maik-blog/layouts/shortcodes/image.html +++ b/themes/maik-blog/layouts/shortcodes/image.html @@ -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 }} \ No newline at end of file diff --git a/themes/maik-blog/layouts/writeups/single.html b/themes/maik-blog/layouts/writeups/single.html index be38198..da0abc6 100644 --- a/themes/maik-blog/layouts/writeups/single.html +++ b/themes/maik-blog/layouts/writeups/single.html @@ -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 }}