feat(helper/image): new image helper (WIP)
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
{{ $i := .Params.image }}
|
||||
{{ $image := partial "helper/image" . }}
|
||||
{{ $context := . }}
|
||||
|
||||
<div class="article-details">
|
||||
{{ with $categories := .Params.categories }}
|
||||
<header class="article-category">
|
||||
{{ range $categories }}
|
||||
{{ if $i }}
|
||||
{{- $image := partial "helper/image" $context | resources.Fingerprint "md5" -}}
|
||||
{{- $20x := $image.Fill "20x20 smart" -}}
|
||||
{{ if and $image.exists $image.local }}
|
||||
{{- $imageRaw := $image.src | resources.Fingerprint "md5" -}}
|
||||
{{- $20x := $imageRaw.Fill "20x20 smart" -}}
|
||||
<a href="/categories/{{ . | urlize }}" class="color-tag"
|
||||
data-image="{{ $20x.RelPermalink }}" data-key="{{ $context.Slug }}" data-hash="{{ $image.Data.Integrity }}">{{ . | humanize }}</a>
|
||||
data-image="{{ $20x.RelPermalink }}" data-key="{{ $context.Slug }}" data-hash="{{ $imageRaw.Data.Integrity }}">{{ . | humanize }}</a>
|
||||
{{ else }}
|
||||
<a href="/categories/{{ . | urlize }}">{{ . | humanize }}</a>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user