feat(helper/image): new image helper (WIP)
This commit is contained in:
@@ -12,13 +12,17 @@
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
{{ if .Params.image }}
|
||||
{{- $image := partial "helper/image" . -}}
|
||||
{{- $thumbnail := $image.Fill "120x120" -}}
|
||||
{{ $image := partial "helper/image" . }}
|
||||
|
||||
<div class="article-image">
|
||||
<img src="{{ $thumbnail.RelPermalink }}" width="{{ $thumbnail.Width }}"
|
||||
height="{{ $thumbnail.Height }}" loading="lazy">
|
||||
</div>
|
||||
{{ if $image.exists }}
|
||||
<div class="article-image">
|
||||
{{ if $image.local }}
|
||||
{{- $thumbnail := $image.src.Fill "120x120" -}}
|
||||
<img src="{{ $thumbnail.RelPermalink }}" width="{{ $thumbnail.Width }}"
|
||||
height="{{ $thumbnail.Height }}" loading="lazy">
|
||||
{{ else }}
|
||||
<img src="{{ $image.src }}" loading="lazy" alt="Featured image of post {{ .Title }}" />
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</article>
|
||||
Reference in New Issue
Block a user