From 900bb5e845c3ad44defbd427cae3d44a4a43321f Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sat, 25 Feb 2023 13:15:44 +0100 Subject: feat: Initial commit --- .../partials/sidebar/auto-collapsible-menu.html | 57 ++++++++++++++++++++ .../partials/sidebar/auto-default-menu.html | 37 +++++++++++++ .../layouts/partials/sidebar/docs-menu.html | 9 ++++ .../layouts/partials/sidebar/docs-toc.html | 26 +++++++++ .../partials/sidebar/manual-collapsible-menu.html | 63 ++++++++++++++++++++++ .../partials/sidebar/manual-default-menu.html | 41 ++++++++++++++ 6 files changed, 233 insertions(+) create mode 100644 code/frontpage/layouts/partials/sidebar/auto-collapsible-menu.html create mode 100644 code/frontpage/layouts/partials/sidebar/auto-default-menu.html create mode 100644 code/frontpage/layouts/partials/sidebar/docs-menu.html create mode 100644 code/frontpage/layouts/partials/sidebar/docs-toc.html create mode 100644 code/frontpage/layouts/partials/sidebar/manual-collapsible-menu.html create mode 100644 code/frontpage/layouts/partials/sidebar/manual-default-menu.html (limited to 'code/frontpage/layouts/partials/sidebar') diff --git a/code/frontpage/layouts/partials/sidebar/auto-collapsible-menu.html b/code/frontpage/layouts/partials/sidebar/auto-collapsible-menu.html new file mode 100644 index 0000000..4600d0a --- /dev/null +++ b/code/frontpage/layouts/partials/sidebar/auto-collapsible-menu.html @@ -0,0 +1,57 @@ + + diff --git a/code/frontpage/layouts/partials/sidebar/auto-default-menu.html b/code/frontpage/layouts/partials/sidebar/auto-default-menu.html new file mode 100644 index 0000000..6e4565b --- /dev/null +++ b/code/frontpage/layouts/partials/sidebar/auto-default-menu.html @@ -0,0 +1,37 @@ + +{{ $currentPage := . -}} +{{ $section := $currentPage.Section -}} +{{ range (where .Site.Sections "Section" "in" $section) }} + {{ range .Sections }} + {{ $active := in $currentPage.RelPermalink .RelPermalink }} +

{{ .Title }}

+ + {{ end }} +{{ end }} diff --git a/code/frontpage/layouts/partials/sidebar/docs-menu.html b/code/frontpage/layouts/partials/sidebar/docs-menu.html new file mode 100644 index 0000000..b7baebb --- /dev/null +++ b/code/frontpage/layouts/partials/sidebar/docs-menu.html @@ -0,0 +1,9 @@ +{{ if and .Site.Params.menu.section.auto .Site.Params.menu.section.collapsibleSidebar -}} + {{ partial "sidebar/auto-collapsible-menu.html" . -}} +{{ else if and .Site.Params.menu.section.auto (not .Site.Params.menu.section.collapsibleSidebar) -}} + {{ partial "sidebar/auto-default-menu.html" . -}} +{{ else if and (not .Site.Params.menu.section.auto) .Site.Params.menu.section.collapsibleSidebar -}} + {{ partial "sidebar/manual-collapsible-menu.html" . -}} +{{ else if and (not .Site.Params.menu.section.auto) (not .Site.Params.menu.section.collapsibleSidebar) -}} + {{ partial "sidebar/manual-default-menu.html" . -}} +{{ end -}} \ No newline at end of file diff --git a/code/frontpage/layouts/partials/sidebar/docs-toc.html b/code/frontpage/layouts/partials/sidebar/docs-toc.html new file mode 100644 index 0000000..c71a7b8 --- /dev/null +++ b/code/frontpage/layouts/partials/sidebar/docs-toc.html @@ -0,0 +1,26 @@ +{{ if and (ne .Params.toc false) (ne .TableOfContents "") -}} +
+ +
+
+ +
+
+
+ +{{ end -}} diff --git a/code/frontpage/layouts/partials/sidebar/manual-collapsible-menu.html b/code/frontpage/layouts/partials/sidebar/manual-collapsible-menu.html new file mode 100644 index 0000000..f83c667 --- /dev/null +++ b/code/frontpage/layouts/partials/sidebar/manual-collapsible-menu.html @@ -0,0 +1,63 @@ + + diff --git a/code/frontpage/layouts/partials/sidebar/manual-default-menu.html b/code/frontpage/layouts/partials/sidebar/manual-default-menu.html new file mode 100644 index 0000000..32c4cd4 --- /dev/null +++ b/code/frontpage/layouts/partials/sidebar/manual-default-menu.html @@ -0,0 +1,41 @@ + +{{ $currentPage := . -}} +{{ $section := $currentPage.Section -}} +{{ range (index .Site.Menus $section) -}} +

{{ .Name }}

+ {{ if .HasChildren -}} + + {{ end -}} +{{ end -}} -- cgit v1.3