Optimisation des images
This commit is contained in:
@@ -8,11 +8,16 @@
|
||||
{{- $extension := path.Ext $remoteURL -}}
|
||||
{{- $cleanFilename := printf "%s%s" $hash $extension | replace "?raw=true" "" -}}
|
||||
{{- $localImage := $remoteImage | resources.Copy (printf "remote-images/%s" $cleanFilename) -}}
|
||||
{{- $resizedImage := $localImage.Resize "1024x" -}}
|
||||
{{- $hasMeta := or $title (or $description $attribution) -}}
|
||||
<figure class="figure-media{{ if $hasMeta }} figure-media-with-meta{{ else }} figure-media-without-meta{{ end }}">
|
||||
<a href="{{ $localImage.RelPermalink }}" title="Cliquez pour agrandir l'image">
|
||||
<img src="{{ $resizedImage.RelPermalink }}" alt="{{ $title }}" title="{{ $title }}">
|
||||
{{- partial "media/display-img.html" (dict
|
||||
"image" $localImage
|
||||
"showMeta" $hasMeta
|
||||
"forceCentered" false
|
||||
"alt" $title
|
||||
"title" $title
|
||||
) -}}
|
||||
</a>
|
||||
{{- if $hasMeta -}}
|
||||
<figcaption class="figure-media-meta cover-meta">
|
||||
|
||||
Reference in New Issue
Block a user