Skip to content
Snippets Groups Projects
Unverified Commit b0ce615b authored by Olivia Simonet's avatar Olivia Simonet Committed by GitHub
Browse files

Ajout de tailles d'image (config) en fonction des layouts aux projets et aux events (#855)


Co-authored-by: default avatarAlexis BENOIT <alex@noesya.coop>
parent a9763cd9
No related branches found
No related tags found
No related merge requests found
......@@ -358,6 +358,32 @@ params:
mobile: 90
tablet: 360
desktop: 255
projects:
alternate:
mobile: 350
tablet: 709
desktop: 1019
grid:
mobile: 327
tablet: 555
desktop: 864
large:
mobile: 350
tablet: 555
desktop: 1019
events:
grid:
mobile: 90
tablet: 360
desktop: 255
large:
mobile: 400
tablet: 360
desktop: 255
list:
mobile: 90
tablet: 360
desktop: 255
testimonials:
mobile: 80
tablet: 160
......
......@@ -8,8 +8,7 @@
{{ partial "projects/project.html" (dict
"project" .
"heading" $heading
"alternate" true
"index" $i
"layout" "alternate"
"options" $options
) }}
{{ end }}
......
......@@ -57,7 +57,7 @@
{{- partial "commons/image.html"
(dict
"image" .Params.image
"sizes" site.Params.image_sizes.sections.projects.item
"sizes" site.Params.image_sizes.blocks.projects.large
) -}}
{{- else -}}
{{- partial "commons/image-default.html" "projects" -}}
......
......@@ -66,10 +66,11 @@
</div>
<div class="media">
{{- if and $options.image .Params.image -}}
{{ $sizes := index site.Params.image_sizes.blocks.events $layout }}
{{- partial "commons/image.html"
(dict
"image" .Params.image
"sizes" site.Params.image_sizes.sections.events.item
"sizes" $sizes
) -}}
{{- else -}}
{{- partial "commons/image-default.html" "events" -}}
......
{{ $project := .project }}
{{ $heading := .heading | default "h2" }}
{{- $direction := "" -}}
{{ $index := .index}}
{{ $direction := "" }}
{{ $layout := .layout | default "grid" }}
{{ $heading_tag := (dict
"open" ((printf "<%s class='project-title' itemprop='name'>" $heading) | safeHTML)
"close" ((printf "</%s>" $heading) | safeHTML)
) }}
{{ $alternate := .alternate | default false }}
{{ $options := .options | default site.Params.projects.index.options }}
{{ with $project }}
......@@ -16,7 +15,7 @@
{{- $direction = partial "GetImageDirection" .Params.image -}}
{{ end }}
<article class="project {{ if $alternate }}{{ $direction }} {{if not (modBool $index 2)}}left{{ else}}right{{end}}{{end}}" itemscope itemtype="https://schema.org/CreativeWork">
<article class="project {{ $direction }}" itemscope itemtype="https://schema.org/CreativeWork">
<div class="project-content">
<div class="project-description">
......@@ -59,10 +58,11 @@
<div class="media">
{{- if .Params.image -}}
{{ $sizes := index site.Params.image_sizes.blocks.projects $layout }}
{{- partial "commons/image.html"
(dict
"image" .Params.image
"sizes" site.Params.image_sizes.sections.projects.item
"sizes" $sizes
) -}}
{{- else -}}
{{- partial "commons/image-default.html" "projects" -}}
......
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