- fix: remove visual arrow from foooter.

- Single-page navigation URL uses navigation_menu_title if available
This commit is contained in:
zjedi 2023-03-23 18:01:14 +01:00
parent 3a3651a999
commit 7954c690a4

View file

@ -2,38 +2,45 @@
{{ $headless := .Site.GetPage "/homepage" }} {{ $headless := .Site.GetPage "/homepage" }}
{{ $sections := $headless.Resources.ByType "page" }} {{ $sections := $headless.Resources.ByType "page" }}
{{ $sections := cond .Site.BuildDrafts $sections (where $sections "Draft" "==" false) }} {{ $sections := cond .Site.BuildDrafts $sections (where $sections "Draft" "==" false) }}
{{ $filtered := where $sections "Params.external" "==" nil }}
<!-- Welcome screen that scrolls out of view -->
<header id="site-head" {{ with .Params.header_image }}style="background-image: url({{ . }})"{{ end }}> <header id="site-head" {{ with .Params.header_image }}style="background-image: url({{ . }})"{{ end }}>
<div class="vertical"> <div class="vertical">
<div id="site-head-content" class="inner"> <div id="site-head-content" class="inner">
{{ with .Params.header_logo }}<img id="blog-logo" src="{{ . }}" />{{ end }} {{ with .Params.header_logo }}<img id="blog-logo" src="{{ . }}" />{{ end }}
{{ if .Site.Params.title_guard }}<div class="title-and-description-guard">{{ 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_headline }}<h1 class="blog-title">{{ . | safeHTML }}</h1>{{ end }}
{{ with .Params.header_subheadline }}<h2 class="blog-description">{{ . | safeHTML }}</h2>{{ end }} {{ with .Params.header_subheadline }}<h2 class="blog-description">{{ . | safeHTML }}</h2>{{ end }}
{{ if .Site.Params.title_guard }}</div>{{ end }} {{ if .Site.Params.title_guard }}</div>{{ end }}
{{ range where $sections ".Params.header_menu" "eq" true }} {{ range where $sections ".Params.header_menu" "eq" true }}
{{ $button_title := .Title }} {{ $button_title := .Title }}
{{ with .Params.header_menu_title }}{{ $button_title = . }}{{ end }} {{ with .Params.header_menu_title }}{{ $button_title = . }}{{ end }}
{{ if isset .Params "external" }} {{ if isset .Params "external" }}
<a class='btn site-menu' href='{{ .Params.external }}'>{{ $button_title }} <icon class="fa fa-external-link"></icon></a> <a class='btn site-menu' href='{{ .Params.external }}'>{{ $button_title }}&nbsp;<icon class="fa fa-external-link"></icon></a>
{{ else }} {{ else }}
<a class='btn site-menu' data-title-anchor='{{ anchorize .Title }}'>{{ $button_title }}</a> {{ $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 }}
{{ end }} {{ end }}
<i id='header-arrow' class="fa fa-angle-down"></i> <i id='header-arrow' class="fa fa-angle-down"></i>
</div> </div>
</div> </div>
</header> </header>
<main class="content" role="main"> <main class="content" role="main">
<div class='fixed-nav'> <!-- Render sticky left navigation menu -->
</div> <div class='fixed-nav'></div>
{{ range $index_val, $elem_val := $filtered }}
{{ $fnav_title := .Title }} <!-- Render single-page content -->
{{ with .Params.navigation_menu_title }}{{ $fnav_title = . }}{{ end }} {{ $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 }}'> <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 .Title }}' class='post {{ if eq $index_val 0 }}first{{ end }} {{ if eq (add $index_val 1) (len $sections) }}last{{ 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"> <header class="post-header">
<h2 class="post-title" data-fnav-title="{{ $fnav_title | safeHTMLAttr }}">{{ .Title | safeHTML }}</h2> <h2 class="post-title" data-fnav-title="{{ $fnav_title | safeHTMLAttr }}">{{ .Title | safeHTML }}</h2>
</header> </header>