Skip to content

Commit 5e7f561

Browse files
committed
refactor: resize images in publications
1 parent 0ad198e commit 5e7f561

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

themes/delphi/layouts/partials/coe/research-papers.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ <h2>Related Research Papers</h2>
1111
<div class="card-grid-item uk-card uk-card-default uk-card-small">
1212
<div class="card-grid-item-date">{{ .year }}</div>
1313
<picture>
14-
<source srcset="{{ ($img.Resize "webp").RelPermalink }}" type="image/webp" />
15-
<img class="card-grid-item-img" src="{{ $img.RelPermalink }}" width="240" height="300" alt="Banner" />
14+
<source srcset="{{ ($img.Resize "300x webp Gaussian").RelPermalink }}" type="image/webp" />
15+
<img
16+
class="card-grid-item-img"
17+
src="{{ ($img).RelPermalink }}"
18+
width="300"
19+
height="300"
20+
alt="{{ .title }}"
21+
/>
1622
</picture>
1723
<div class="uk-flex uk-flex-column">
1824
<div class="uk-card-body uk-flex-1">

themes/delphi/layouts/shortcodes/research-papers.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
{{ $img := $images.GetMatch (path.Join "images" .image) }}
55
<div class="card-grid-item uk-card uk-card-default uk-card-small">
66
<div class="card-grid-item-date">{{ .year }}</div>
7-
<img class="card-grid-item-img" src="{{ $img.RelPermalink }}" width="240" height="300" alt="Banner" />
7+
<picture>
8+
<source srcset="{{ ($img.Resize "300x webp Gaussian").RelPermalink }}" type="image/webp" />
9+
<img class="card-grid-item-img" src="{{ ($img).RelPermalink }}" width="300" height="300" alt="{{ .title }}" />
10+
</picture>
811
<div class="uk-flex uk-flex-column">
912
<div class="uk-card-body uk-flex-1">
1013
<h3 class="uk-card-title"><a href="{{ .link }}" class="uk-link-heading">{{ .title }}</a></h3>

0 commit comments

Comments
 (0)