blob: b98d5bfff108fa63dada2ca4bb319386778df280 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
{{$currentPageContext := .}}
{{with .Params.projects}}
<ul class="projects clearfix">
{{- range . -}}
<li class="project{{with .class}} {{.}}{{end}}">
<a href="{{.link}}">
<picture>
{{- with .responsive_images -}}
{{range $imageWidth, $imageUrl := .}}
{{ $currentPageContext.Scratch.Add "srcSetArray" (slice (print ($imageUrl | relURL) " " $imageWidth "w")) }}
{{end}}
<source media="(max-width: 46.25em)" srcset="{{delimit ($currentPageContext.Scratch.Get "srcSetArray") ", "}}">
{{ $currentPageContext.Scratch.Delete "srcSetArray" }}
{{- end -}}
<img class="project-image" src="{{.image | relURL}}" alt="{{.image_alt}}">
</picture>
<div class="project-hover">
<div class="project-caption">
{{- with .title -}}
<div class="project-title">{{.}}</div>
{{- end -}}
{{- with .type -}}
<div class="project-type">{{.}}</div>
{{- end -}}
</div>
</div>
</a>
</li>
{{- end -}}
</ul>
{{- end -}}
|