Skip to content
Snippets Groups Projects
Unverified Commit 779cf22f authored by Alexis BENOIT's avatar Alexis BENOIT Committed by GitHub
Browse files

Merge pull request #78 from noesya/refacto/partners

refacto partners block partial
parents 43bad57f b648e9d8
No related branches found
No related tags found
No related merge requests found
...@@ -5,5 +5,7 @@ ...@@ -5,5 +5,7 @@
max-width: col(8) max-width: col(8)
@include in-page-with-sidebar @include in-page-with-sidebar
.organizations .organizations
@include grid(2, md)
@include grid(3, lg)
@include grid(4, xl) @include grid(4, xl)
grid-column-gap: half($grid-gutter) !important grid-column-gap: half($grid-gutter) !important
.organization .organization
@include article @include article
position: relative position: relative
h2 h2, h3
@include meta @include meta
a a
@include stretched-link @include stretched-link
text-decoration: none text-decoration: none
display: block
.media .media
background: $color-background-alt background: $color-background-alt
padding: $spacing1 padding: $spacing1
margin-bottom: half($spacing0) margin-bottom: half($spacing0)
picture picture
aspect-ratio: 1/1 aspect-ratio: 1
display: block display: block
img img
width: 100% width: 100%
height: 100% height: 100%
object-fit: contain object-fit: contain
object-position: center object-position: center
&:empty
position: relative
&::after
content: ''
display: block
padding-bottom: 100%
.organizations .organizations
max-width: 100% max-width: 100%
......
...@@ -22,45 +22,52 @@ ...@@ -22,45 +22,52 @@
<div class="organizations"> <div class="organizations">
{{- range .partners }} {{- range .partners }}
<div> {{ if .slug }}
{{- if .slug }} {{ with (site.GetPage (printf "/organizations/%s" .slug )) }}
{{ with (site.GetPage (printf "/organizations/%s" .slug )) }} {{ template "partner" (dict
{{- partial "organizations/organization.html" . -}} "title" .Title
{{ end }} "url" .Permalink
{{- else -}} "logo" .Params.logo
<article class="organization"> )}}
{{- $title := "" -}} {{ end }}
{{ if .name }} {{ else }}
<div> {{ template "partner" (dict
{{ $title = partial "PrepareHTML" .name -}} "title" .name
<h3> "url" .url
{{- if .url }} "logo" .logo
<a href="{{ .url }}" title="{{ safeHTML (i18n "commons.link.blank_aria" (dict "Title" $title)) }}"> )}}
{{ end }} {{ end }}
{{- $title -}}
{{ if .url }}
</a>
{{ end -}}
</h3>
</div>
{{ end -}}
<div class="media">
{{- if .logo -}}
{{- partial "commons/image.html"
(dict
"image" .logo
"alt" $title
"sizes" site.Params.image_sizes.blocks.partners
) -}}
{{- end -}}
</div>
</article>
{{ end -}}
</div>
{{ end -}} {{ end -}}
</div> </div>
</div> </div>
</div> </div>
</section> </section>
{{- end -}} {{- end -}}
{{- define "partner" -}}
<article class="organization">
{{ $title := "" }}
{{ if .title }}
{{ $title = partial "PrepareHTML" .title -}}
<h3>
{{- if .url }}
<a href="{{ .url }}" title="{{ safeHTML (i18n "commons.link.blank_aria" (dict "Title" $title)) }}">
{{ end -}}
{{- $title -}}
{{- if .url }}
</a>
{{ end -}}
</h3>
{{ end -}}
<div class="media">
{{- if .logo -}}
{{- partial "commons/image.html"
(dict
"image" .logo
"alt" $title
"sizes" site.Params.image_sizes.blocks.partners
) -}}
{{- end -}}
</div>
</article>
{{- end -}}
\ No newline at end of file
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