2025-03-30 11:49:43 +02:00
|
|
|
{{- $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) -}}
|
2025-03-30 16:02:18 +02:00
|
|
|
|
|
|
|
{{- $currentPages := index $currentEntry $menuPrefix | default slice -}}
|
2025-03-30 11:49:43 +02:00
|
|
|
{{- $currentPages = $currentPages | append .RelPermalink -}}
|
2025-03-30 16:02:18 +02:00
|
|
|
{{- $currentEntry = merge $currentEntry (dict $menuPrefix $currentPages) -}}
|
|
|
|
|
|
|
|
{{- $isInSlice := .Store.Get "isin"|default slice -}}
|
|
|
|
{{ warnf "%s: %#v" .RelPermalink $isInSlice }}
|
|
|
|
{{- $isInSlice = $isInSlice | append $currentPage.RelPermalink -}}
|
|
|
|
{{ .Store.Set "isin" (uniq $isInSlice) }}
|
2025-03-30 11:49:43 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- if gt (len $currentEntry) 0 -}}
|
2025-03-30 16:02:18 +02:00
|
|
|
{{- $currentPage.Store.Set "graph" $currentEntry -}}
|
2025-03-30 11:49:43 +02:00
|
|
|
{{- end -}}
|