resize images

This commit is contained in:
nyanloutre 2020-12-06 17:08:33 +01:00
parent dfdd779b31
commit 6eae9acbf6
Signed by: nyanloutre
GPG Key ID: 194A92D1103ACB2A
1 changed files with 4 additions and 3 deletions

View File

@ -4,10 +4,11 @@
<div class="content portfolio"> <div class="content portfolio">
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
<div id="portfolio-gallery"> <div id="portfolio-gallery">
{{ range .Params.images }} {{ range $index, $element := .Params.images }}
{{ $img := $.Page.Resources.GetMatch . }} {{ $img := $.Page.Resources.GetMatch $element }}
{{ $res_img := $img.Fill (cond (eq $index 0) "1920x1080" "640x360") }}
<a href="{{ $img.RelPermalink }}"> <a href="{{ $img.RelPermalink }}">
<img src="{{ $img.RelPermalink }}" alt=""> <img src="{{ $res_img.RelPermalink }}" alt="">
</a> </a>
{{ end }} {{ end }}
</div> </div>