From 4b482386897dc0aaa3d1d0317d26b37eee296373 Mon Sep 17 00:00:00 2001 From: Marcell Mars Date: Sun, 30 Mar 2025 23:55:57 +0200 Subject: [PATCH] store add and graph not deferred --- layouts/partials/deferred_page_graph.html | 6 +++--- layouts/partials/single-page-graph.html | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/layouts/partials/deferred_page_graph.html b/layouts/partials/deferred_page_graph.html index 7afd82a..7f2a0d7 100644 --- a/layouts/partials/deferred_page_graph.html +++ b/layouts/partials/deferred_page_graph.html @@ -1,8 +1,8 @@ {{ $currentPage := . }} +{{ $pageGraph := $currentPage.Store.Get "graph"}} +

{{ printf "%#v" $pageGraph }}

+ {{- with templates.Defer -}} - {{ $pageGraph := $currentPage.Store.Get "graph"}} {{ $pageIsIn := $currentPage.Store.Get "isin"}} - {{/* warnf "DEFERRED: %#v" $pageGraph */}} -

{{ printf "%#v" $pageGraph }}

{{ printf "%#v" $pageIsIn }}

{{- end -}} diff --git a/layouts/partials/single-page-graph.html b/layouts/partials/single-page-graph.html index 53fe189..241ad78 100644 --- a/layouts/partials/single-page-graph.html +++ b/layouts/partials/single-page-graph.html @@ -24,15 +24,12 @@ {{- if reflect.IsSlice $pages -}} {{- range $page := $pages -}} {{- with site.GetPage (printf "%s/%s" $section $page) -}} - {{- $currentPages := index $currentEntry $menuPrefix | default slice -}} {{- $currentPages = $currentPages | append .RelPermalink -}} {{- $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) }} + {{- $isInSlice := .Store.Get "isin" | default slice -}} + {{ .Store.Add "isin" (slice $currentPage.RelPermalink) }} {{- end -}} {{- end -}} {{- end -}}