mirror of
https://github.com/maikka39/Personal-Website.git
synced 2026-10-02 14:46:25 +00:00
Convert all images to webp when possible
This commit is contained in:
@@ -45,16 +45,7 @@
|
||||
|
||||
{{- if .Params.Cover }}
|
||||
<figure class="post-cover">
|
||||
{{- $img := imageConfig (printf "static/%s" .Params.Cover) }}
|
||||
|
||||
{{- if .Params.UseRelativeCover }}
|
||||
<img src="{{ (printf "%s%s" .Permalink .Params.Cover ) }}"
|
||||
alt="{{ .Title | plainify | default " " }}" width="{{ $img.Width }}"
|
||||
height="{{ $img.Height }}" />
|
||||
{{- else }}
|
||||
<img src="{{ .Params.Cover | absURL }}" alt="{{ .Title | plainify | default " " }}"
|
||||
width="{{ $img.Width }}" height="{{ $img.Height }}" />
|
||||
{{- end }}
|
||||
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify)) }}
|
||||
|
||||
{{- if .Params.CoverCaption }}
|
||||
<figcaption class="center">{{ .Params.CoverCaption | markdownify }}</figcaption>
|
||||
|
||||
@@ -38,9 +38,7 @@
|
||||
{{- end }}
|
||||
|
||||
{{- if .Params.Cover }}
|
||||
{{ $img := imageConfig (printf "static/%s" .Params.Cover) }}
|
||||
<img src="/{{ .Params.Cover }}" class="post-cover" alt="{{ .Title | plainify | default " " }}"
|
||||
width="{{ $img.Width }}" height="{{ $img.Height }}" />
|
||||
{{- partial "image.html" (dict "path" .Params.Cover "alt" (.Title | plainify | default " ") "class" "post-cover") }}
|
||||
{{- end }}
|
||||
|
||||
<div class="post-content">
|
||||
|
||||
Reference in New Issue
Block a user