feat: support leaf bundles for blog posts, refactor header images
This commit is contained in:
15
themes/hugo-sustain/layouts/partials/blog/headerimage.html
Normal file
15
themes/hugo-sustain/layouts/partials/blog/headerimage.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{- $page := . -}}
|
||||
{{- with $page.Params.headerimage }}
|
||||
<div class="header-image">
|
||||
{{- if eq $page.BundleType "leaf" }}
|
||||
{{- with $page.Resources.GetMatch .src }}
|
||||
<img src="{{ .RelPermalink }}" />
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- with resources.GetMatch (printf "**/%s" .src) }}
|
||||
<img src="{{ .RelPermalink }}" />
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .text }}<p>{{ . | markdownify }}</p>{{ end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user