mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-02-02 03:22:33 -06:00
Resize images displayed in article-link.html
Currently the images are displayed at their full resolution. Those images could be very large, but end up being displayed as 300px wide. This changes that by resizing those images to a more suitable size.
This commit is contained in:
parent
eea1e72d81
commit
e9a17fa52d
1 changed files with 4 additions and 4 deletions
|
@ -30,9 +30,9 @@
|
||||||
{{- $featured := $images.GetMatch "*feature*" -}}
|
{{- $featured := $images.GetMatch "*feature*" -}}
|
||||||
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
|
||||||
{{- with $featured -}}
|
{{- with $featured -}}
|
||||||
|
{{ with .Resize "600x" }}
|
||||||
<div class="{{ $articleImageClasses }}" style="background-image:url({{ $featured.Permalink }});"></div>
|
<div class="{{ $articleImageClasses }}" style="background-image:url({{ .RelPermalink }});"></div>
|
||||||
|
{{ end }}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- with $.Site.Params.images }}
|
{{- with $.Site.Params.images }}
|
||||||
<meta property="og:image" content="{{ index . 0 | absURL }}" />{{ end -}}
|
<meta property="og:image" content="{{ index . 0 | absURL }}" />{{ end -}}
|
||||||
|
@ -76,4 +76,4 @@
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in a new issue