diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..ae1b791 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,18 @@ +{{- $homepage := .Site.Params.home -}} + + +
++ If you are not redirected automatically, follow this + link. +
+ + diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html new file mode 100644 index 0000000..3bb99f9 --- /dev/null +++ b/layouts/partials/breadcrumbs.html @@ -0,0 +1,25 @@ +{{- $home := .Page.GetPage .Site.Params.home -}} + +{{ debug.Dump .Site.Params }}diff --git a/layouts/partials/deferred_global_graph.html b/layouts/partials/deferred_global_graph.html new file mode 100644 index 0000000..8245c53 --- /dev/null +++ b/layouts/partials/deferred_global_graph.html @@ -0,0 +1,4 @@ +{{- with templates.Defer -}} + {{- $globalGraph := site.Home.Store.Get "graph" -}} + {{- warnf "%s" ($globalGraph | jsonify (dict "prefix" " " "indent" " ")) -}} +{{- end -}} diff --git a/layouts/partials/single-page-graph.html b/layouts/partials/single-page-graph.html new file mode 100644 index 0000000..a87b70a --- /dev/null +++ b/layouts/partials/single-page-graph.html @@ -0,0 +1,40 @@ +{{- $currentPage := . -}} +{{- $sectionMap := site.Data.sandpointsnamegraph -}} + +{{ $currentEntry := dict }} + +{{- $menuPrefix := "" -}} +{{- $section := "" -}} +{{- range $sectionMaybe, $pages := $currentPage.Params -}} + {{- if strings.Contains $sectionMaybe "_" -}} + {{- $sectionsSlice := split (strings.TrimPrefix "_" $sectionMaybe) "_" -}} + {{- if gt (len $sectionsSlice) 0 -}} + {{- $pluralSection := index (last 1 $sectionsSlice) 0 -}} + {{- range $singular, $plural := $sectionMap -}} + {{- if eq $plural $pluralSection -}} + {{- $section = $singular -}} + {{- end -}} + {{- end -}} + {{- where site.Pages "Section" $section -}} + {{- $menuPrefix = "no-prefix" -}} + {{- if gt (len $sectionsSlice) 1 -}} + {{- $menuPrefix = delimit (first (sub (len $sectionsSlice) 1) $sectionsSlice) " " -}} + {{- else -}} + {{- end -}} + {{- if reflect.IsSlice $pages -}} + {{- range $page := $pages -}} + {{- with site.GetPage (printf "%s/%s" $section $page) -}} + {{- $currentPrefix := index $currentEntry $currentPage.RelPermalink | default (dict $menuPrefix slice) -}} + {{- $currentPages := index $currentPrefix $menuPrefix | default (slice .RelPermalink) -}} + {{- $currentPages = $currentPages | append .RelPermalink -}} + {{- $currentPrefix = merge $currentPrefix (dict $menuPrefix (uniq $currentPages)) -}} + {{- $currentEntry = merge $currentEntry (dict $currentPage.RelPermalink $currentPrefix) -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} + {{- end -}} +{{- end -}} +{{- if gt (len $currentEntry) 0 -}} + {{- site.Home.Store.SetInMap "graph" $currentPage.RelPermalink $currentEntry -}} +{{- end -}} diff --git a/layouts/shortcodes/include.html b/layouts/shortcodes/include.html new file mode 100644 index 0000000..56f842b --- /dev/null +++ b/layouts/shortcodes/include.html @@ -0,0 +1 @@ +{{ with site.GetPage (.Get 0) }} {{ .RenderShortcodes }} {{ end }}