Skip to content
Snippets Groups Projects
Commit f915aece authored by Olivia206's avatar Olivia206
Browse files

changed image-default partial

parent 445f4f1a
No related branches found
No related tags found
No related merge requests found
......@@ -50,19 +50,14 @@
</div>
<div class="media">
{{ $post_image := "" }}
{{- if .Params.image -}}
{{ $post_image = .Params.image }}
{{- else if site.Params.posts.default_image -}}
{{ $post_image = site.Data.website.default_image }}
{{ end }}
{{- if or .Params.image site.Params.posts.default_image -}}
{{- partial "commons/image.html"
(dict
"image" $post_image
"image" .Params.image
"sizes" site.Params.image_sizes.sections.posts.item
) -}}
{{- else if site.Data.website.default_image -}}
{{- partial "commons/image-default.html" -}}
{{- end -}}
</div>
</article>
......
{{- if os.FileExists "static/assets/images/default.png" -}}
{{ $file := "/assets/images/default.png" }}
{{ $fileDimensions := partial "GetImageDimensions" (dict "context" . "file" $file "static" true) }}
{{- $lazy := default true .lazy -}}
<img alt="" src="{{ $file }}" width="{{ index $fileDimensions 1 }}" height="{{ index $fileDimensions 0 }}"
{{- if .class }} class="{{ .class }}"{{- end -}}
{{- if $lazy }} loading="lazy"{{- end -}}
>
{{ else if os.FileExists "static/assets/images/default.jpg" }}
{{ $file := "/assets/images/default.jpg" }}
{{ $fileDimensions := partial "GetImageDimensions" (dict "context" . "file" $file "static" true) }}
{{- $lazy := default true .lazy -}}
<img alt="" src="{{ $file }}" width="{{ index $fileDimensions 1 }}" height="{{ index $fileDimensions 0 }}"
{{- if .class }} class="{{ .class }}"{{- end -}}
{{- if $lazy }} loading="lazy"{{- end -}}
>
{{- end -}}
{{- partial "commons/image.html"
(dict
"image" site.Data.website.default_image
) -}}
\ No newline at end of file
......@@ -45,10 +45,10 @@
<p class="event-status">
{{ if eq .Params.dates.status "current"}}
{{- i18n "blocks.events.current" -}}
{{ else if .Params.dates.status "future" }}
{{ else if eq .Params.dates.status "future" }}
{{- i18n "blocks.events.future" -}}
{{ else if .Params.dates.status "archive" }}
{{- i18n "blocks.events.archive" -}}
{{ else if eq .Params.dates.status "archive" }}
{{- i18n "blocks.events.archive" -}}
{{ end }}
</p>
{{ end }}
......@@ -83,20 +83,15 @@
{{ end }}
</div>
<div class="media">
{{ $event_image := "" }}
{{- if .Params.image -}}
{{ $event_image = .Params.image }}
{{- else if site.Params.events.default_image -}}
{{ $event_image = site.Data.website.default_image }}
{{ end }}
{{- if or .Params.image site.Params.events.default_image -}}
{{- partial "commons/image.html"
(dict
"image" $event_image
"sizes" site.Params.image_sizes.sections.events.item
) -}}
{{- end -}}
(dict
"image" .Params.image
"sizes" site.Params.image_sizes.sections.events.item
) -}}
{{- else if site.Data.website.default_image -}}
{{- partial "commons/image-default.html" -}}
{{- end -}}
</div>
</article>
{{ end }}
\ No newline at end of file
......@@ -24,11 +24,12 @@
{{- end -}}
{{- end -}}
{{- $seoImage := "" -}}
{{- $defaultImage := site.Data.website.default_image -}}
{{- if $defaultImage -}}
{{- if os.FileExists "static/assets/images/share.png" -}}
{{- $seoImage = printf "%s/assets/images/share.png" site.BaseURL -}}
{{- end -}}
{{- if os.FileExists "static/assets/images/share.jpg" -}}
{{- $seoImage = printf "%s/assets/images/share.jpg" site.BaseURL -}}
{{- end -}}
{{- $ogImage := $seoImage -}}
{{- $twitterImage := $seoImage -}}
{{- $pagefindImage := $seoImage -}}
......@@ -89,5 +90,4 @@
Limiter le tracking par le CDN
https://framagit.org/chatons/CHATONS/-/issues/200#note_1987024
*/}}
<meta name="referrer" content="no-referrer">
\ No newline at end of file
<meta name="referrer" content="no-referrer">
\ No newline at end of file
......@@ -49,19 +49,14 @@
</div>
<div class="media">
{{ $post_image := "" }}
{{- if .Params.image -}}
{{ $post_image = .Params.image }}
{{- else if site.Params.posts.default_image -}}
{{ $post_image = site.Data.website.default_image }}
{{ end }}
{{- if or .Params.image site.Params.posts.default_image -}}
{{- partial "commons/image.html"
(dict
"image" $post_image
"sizes" site.Params.image_sizes.sections.posts.item
) -}}
(dict
"image" .Params.image
"sizes" site.Params.image_sizes.sections.posts.item
) -}}
{{- else if site.Data.website.default_image -}}
{{- partial "commons/image-default.html" -}}
{{- end -}}
</div>
</article>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment