Merge pull request #108 from chrisbanes/cb/article-link-resize

Resize images displayed in article-link.html
This commit is contained in:
Nuno Coração 2022-10-15 15:34:30 +01:00 committed by GitHub
commit c2d01e5dbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,9 +30,9 @@
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ $featured.Permalink }});"></div>
{{ with .Resize "600x" }}
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{- else -}}
{{- with $.Site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}" />{{ end -}}
@ -76,4 +76,4 @@
</div>
{{ end }}
</div>
</a>
</a>