Allow rendering subdirectories as scrolling pages

This commit is contained in:
Kostas Chatzikokolakis 2024-07-01 00:27:53 +03:00 committed by zjedi
parent 94a56ac555
commit d92da3689a
2 changed files with 10 additions and 8 deletions

View file

@ -1,9 +1,9 @@
{{ define "main" }} {{ define "main" }}
{{ $headless := .Site.GetPage "/homepage" }} {{ $headless := .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) }}
{{ $content := where (where $sections "Params.external" "==" nil) "Params.detailed_page_homepage_content" "ne" false }} {{ $content := where (where $sections "Params.external" "==" nil) "Params.detailed_page_homepage_content" "ne" false }}
{{ $languages := .Site.Languages }} {{ $translations := .Page.AllTranslations }}
<!-- Welcome screen that scrolls out of view --> <!-- Welcome screen that scrolls out of view -->
{{ if not .Params.header_use_video }} {{ if not .Params.header_use_video }}
@ -35,17 +35,17 @@
{{- partial "custom_header_video.html" . -}} {{- partial "custom_header_video.html" . -}}
{{ end }} {{ end }}
{{ $num_lang := len $languages }} {{ $num_lang := len $translations }}
{{ if and (gt $num_lang 1) $.Site.Params.language_menu }} {{ if and (gt $num_lang 1) $.Site.Params.language_menu }}
<div id="site-languages" class="inner"> <div id="site-languages" class="inner">
{{ range site.Sites }} {{ range $translations }}
{{ $lang_title := or .Language.LanguageName (.Language.Lang | strings.ToUpper) }} {{ $lang_title := or .Language.LanguageName (.Lang | strings.ToUpper) }}
{{ if eq . $.Site }} {{ if eq .Lang $.Lang }}
{{ if $.Site.Params.show_current_lang }} {{ if $.Site.Params.show_current_lang }}
<span class='btn-lang active'>{{ $lang_title }}</span> <span class='btn-lang active'>{{ $lang_title }}</span>
{{ end }} {{ end }}
{{ else }} {{ else }}
<a class='btn-lang' href='{{ .Home.Permalink }}'>{{ $lang_title }}</a> <a class='btn-lang' href='{{ .RelPermalink }}'>{{ $lang_title }}</a>
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>

View file

@ -2,7 +2,9 @@
<main class="content page-template page-{{ .Slug }}"> <main class="content page-template page-{{ .Slug }}">
<article class="post page"> <article class="post page">
<header class="post-header"> <header class="post-header">
<a id="back-to-main-page" href="{{ "" | relLangURL }}"><i class="fa fa-chevron-left" aria-hidden="true"></i> {{ .Site.Title }}</a> {{ with .Parent }}
<a id="back-to-main-page" href="{{ .RelPermalink | relLangURL }}"><i class="fa fa-chevron-left" aria-hidden="true"></i> {{ or .Title .Site.Title }}</a>
{{ end }}
</header> </header>
<h1 class="post-title">{{ .Title }}</h1> <h1 class="post-title">{{ .Title }}</h1>
<section class="post-content"> <section class="post-content">