hugo-theme-toastersrocks/layouts/partials/articlehead.html

11 lines
362 B
HTML
Raw Permalink Normal View History

2020-11-29 02:41:06 +00:00
{{ if .Params.Images }}
{{ $img := index .Params.Images 0 }}
{{ with ( imageConfig ( printf "/static%s" $img ) ) }}
{{ $ratio := (div .Height (add 0.0 .Width)) }}
<article style="background-image: url('{{ $img }}');">
<div class="metadata" style="height: calc((var(--height) - 2em) * {{ $ratio }} - 3.5em)">
{{ end }}
{{ else }}
<article>
<div>
{{ end }}