hugo-scroll/layouts/index.html
Zdenek K 6f7f95f181 Cover video - initial transplant
Transplanted cover video feature from fork of @thomasjungblut and adapted to latest hugo scroll code

Co-Authored-By: Thomas Jungblut <thomas.jungblut@gmail.com>
2023-04-05 21:34:45 +02:00

68 lines
3.4 KiB
HTML

{{ define "main" }}
{{ $headless := .Site.GetPage "/homepage" }}
{{ $sections := $headless.Resources.ByType "page" }}
{{ $sections := cond .Site.BuildDrafts $sections (where $sections "Draft" "==" false) }}
<!-- Welcome screen that scrolls out of view -->
{{ if not .Params.header_use_video }}
<header id="site-head" class="withCenteredImage" {{ with .Params.header_image }}style="background-image: url({{ . }})"{{ end }}>
{{ else }}
<header id="site-head">
{{ end }}
<div class="vertical">
{{ if .Params.header_use_video }}
<!-- A partial to be overwritten by the user.
Simply place a custom_header_video.html into
your local /layouts/partials-directory -->
{{- partial "custom_header_video.html" . -}}
{{ end }}
<div id="site-head-content" class="inner">
{{ with .Params.header_logo }}<img id="blog-logo" src="{{ . }}" />{{ end }}
{{ if .Site.Params.title_guard }}<div class="title-and-description-guard">{{ end }}
{{ with .Params.header_headline }}<h1 class="blog-title">{{ . | safeHTML }}</h1>{{ end }}
{{ with .Params.header_subheadline }}<h2 class="blog-description">{{ . | safeHTML }}</h2>{{ end }}
{{ if .Site.Params.title_guard }}</div>{{ end }}
{{ range where $sections ".Params.header_menu" "eq" true }}
{{ $button_title := .Title }}
{{ with .Params.header_menu_title }}{{ $button_title = . }}{{ end }}
{{ if isset .Params "external" }}
<a class='btn site-menu' href='{{ .Params.external }}'>{{ $button_title }}&nbsp;<icon class="fa fa-external-link"></icon></a>
{{ else }}
{{ $fnav_title := .Title }}{{ with .Params.navigation_menu_title }}{{ $fnav_title = . }}{{ end }}
<a class='btn site-menu' data-title-anchor='{{ anchorize $fnav_title }}'>{{ $button_title }}</a>
{{ end }}
{{ end }}
<i id='header-arrow' class="fa fa-angle-down"></i>
</div>
</div>
</header>
<main class="content" role="main">
<!-- Render sticky left navigation menu -->
<div class='fixed-nav'></div>
<!-- Render single-page content -->
{{ $content := where $sections "Params.external" "==" nil }}
{{ range $index_val, $elem_val := $content }}
{{ $fnav_title := .Title }}{{ with .Params.navigation_menu_title }}{{ $fnav_title = . }}{{ end }}
<div class='post-holder{{ if and (ne .Site.Params.invertSectionColors true) (not (modBool $index_val 2)) }} dark{{ else if and (eq .Site.Params.invertSectionColors true) (modBool $index_val 2) }} dark{{ end }}'>
<article id='{{ anchorize $fnav_title }}' class='post {{ if eq $index_val 0 }}first{{ end }} {{ if eq (add $index_val 1) (len $content) }}last{{ end }}'>
<header class="post-header">
<h2 class="post-title" data-fnav-title="{{ $fnav_title | safeHTMLAttr }}">{{ .Title | safeHTML }}</h2>
</header>
<section class="post-content">
{{ .Content }}
</section>
</article>
<div class='post-after{{ if and (ne .Site.Params.invertSectionColors true) (modBool $index_val 2) }} light{{ else if and (eq .Site.Params.invertSectionColors true) (not (modBool $index_val 2)) }} light{{ end }}'></div>
</div>
{{ end }}
</main>
{{ end }}