Emiliano Tortorella 9be3215a9e Post header parametrization added:
post_header_class (so I could change it to "cover bg-center")
post_header_div_class (so I could change it to "bg-black-60")
post_header_show_title (so I could display the post title only once, 
down in the post)
2018-11-10 23:16:11 -04:00

27 lines
1.1 KiB
HTML

{{ $featured_image := .Params.featured_image }}
{{ if $featured_image }}
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}}
{{ $featured_image := (trim $featured_image "/") | absURL }}
<header class="{{ .Site.Params.post_header_class | default "cover bg-top" }}" style="background-image: url('{{ $featured_image }}');">
<div class="{{ .Site.Params.post_header_div_class | default "pb3-m pb6-l bg-black-60" }}">
{{ partial "site-navigation.html" . }}
<div class="tc-l pv6 ph3 ph4-ns">
{{ if .Site.Params.post_header_show_title }}
<h1 class="f2 f1-l fw2 white-90 mb0 lh-title">{{ .Title | default .Site.Title }}</h1>
{{ with .Params.description }}
<h2 class="fw1 f5 f3-l white-80 measure-wide-l center lh-copy mt3 mb4">
{{ . }}
</h2>
{{ end }}
{{ end }}
</div>
</div>
</header>
{{ else }}
<header>
<div class="{{ .Site.Params.background_color_class | default "bg-black" }}">
{{ partial "site-navigation.html" . }}
</div>
</header>
{{ end }}