From 5b4c79e68942541ba591bac30fa00834aa12de69 Mon Sep 17 00:00:00 2001 From: spi <22529093+spi43984@users.noreply.github.com> Date: Sat, 14 Oct 2023 15:23:18 +0200 Subject: [PATCH] Link to dedicated page from site head (#158) - dedicated pages can be linked from landing area - briefer version of that page can be included on the singe-page content --- exampleSite/content/homepage/legal-brief.md | 16 ++++++++++++++++ exampleSite/content/legal.md | 6 ++++++ layouts/index.html | 4 +++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 exampleSite/content/homepage/legal-brief.md create mode 100644 exampleSite/content/legal.md diff --git a/exampleSite/content/homepage/legal-brief.md b/exampleSite/content/homepage/legal-brief.md new file mode 100644 index 0000000..044ae04 --- /dev/null +++ b/exampleSite/content/homepage/legal-brief.md @@ -0,0 +1,16 @@ +--- +title: "Brief Legal Information" +weight: 98 +header_menu_title: "Legal" +navigation_menu_title: "Legal stuff" +header_menu: true +detailed_page_path: /legal/ +detailed_page_homepage_content: true +--- +The file **legal-brief.md** creates an internal link on the cover page without the leading icon. + +If the parameter `detailed_page_homepage_content` is set to false neither this section nor the navigation menu entry will be shown (but the link on the cover page will be). + +If `detailed_page_homepage_content` is set to true or is missing at all, the link, navigation menu and the content will be rendered. In that case this section might contain less or just summarized information compared to the single page referenced by the parameter `detailed_page_path`. + +Want to see more about the details? See [dedicated page](legal) with more details or hit the button 'Legal' on the cover page. \ No newline at end of file diff --git a/exampleSite/content/legal.md b/exampleSite/content/legal.md new file mode 100644 index 0000000..5680b86 --- /dev/null +++ b/exampleSite/content/legal.md @@ -0,0 +1,6 @@ +--- +title: "The single page referenced to by the Legal button on the cover page" +--- +This file is a single page and is referenced by the button `Legal` on the cover start page. + +It can contain more or additional information than the dedicated section on the homepage. diff --git a/layouts/index.html b/layouts/index.html index 78c361b..1da4347 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -2,7 +2,7 @@ {{ $headless := .Site.GetPage "/homepage" }} {{ $sections := $headless.Resources.ByType "page" }} {{ $sections := cond .Site.BuildDrafts $sections (where $sections "Draft" "==" false) }} -{{ $content := where $sections "Params.external" "==" nil }} +{{ $content := where (where $sections "Params.external" "==" nil) "Params.detailed_page_homepage_content" "ne" false }} {{ if not .Params.header_use_video }} @@ -34,6 +34,8 @@ {{ if isset .Params "external" }} {{ $button_title }}  + {{ else if isset .Params "detailed_page_path" }} + {{ $button_title }} {{ else }} {{ $fnav_title := .Title }}{{ with .Params.navigation_menu_title }}{{ $fnav_title = . }}{{ end }} {{ $button_title }}