mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 17:22:46 +00:00
35 lines
1.4 KiB
HTML
35 lines
1.4 KiB
HTML
{{- $featured_image := partial "func/GetFeaturedImage.html" . -}}
|
|
{{- if or $featured_image .Params.featured_image -}}
|
|
{{- $featured_image_link := "" -}}
|
|
{{- if $featured_image -}}
|
|
{{- .Scratch.Set "featured_image" $featured_image -}}
|
|
{{- $featured_image_link = $featured_image.RelPermalink -}}
|
|
{{- else -}}
|
|
{{- $featured_image_link = .Params.featured_image -}}
|
|
{{- end -}}
|
|
{{- $sassTemplate := resources.Get "sass/header-image.scss" -}}
|
|
{{- $style := $sassTemplate | resources.ExecuteAsTemplate (print ($featured_image_link | base64Encode) "header-image.scss") . | resources.ToCSS -}}
|
|
<link rel="stylesheet" href="{{ $style.Permalink }}" media="screen">
|
|
<header class="cover bg-top has-header-image">
|
|
<div class="bg-black-60">
|
|
{{ partial "site-navigation.html" . }}
|
|
<div class="tc-l pv6 ph3 ph4-ns">
|
|
{{ if not .Params.omit_header_text }}
|
|
<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 }}
|