feat: add image processing, improvements
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
{{- $page := . -}}
|
||||
{{- $image := "" }}
|
||||
{{- with $page.Params.headerimage }}
|
||||
<div class="header-image">
|
||||
{{- if eq $page.BundleType "leaf" }}
|
||||
{{- with $page.Resources.GetMatch .src }}
|
||||
<img src="{{ .RelPermalink }}" />
|
||||
{{- $image = . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- with resources.GetMatch (printf "**/%s" .src) }}
|
||||
<img src="{{ .RelPermalink }}" />
|
||||
{{- $image = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $processes := .processes | default (slice "fill 1000x440 webp" )}}
|
||||
{{- $image = partial "image-processing" (dict "image" $image "processes" $processes "filter" .filter) -}}
|
||||
{{- with $image }}
|
||||
<img src="{{ .RelPermalink }}" />
|
||||
{{- end }}
|
||||
{{- with .text }}<p>{{ . | markdownify }}</p>{{ end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user