30 lines
1.4 KiB
HTML
30 lines
1.4 KiB
HTML
{{ $currentPage := . }}
|
|
{{ $currentPageGraph := $currentPage.Store.Get "graph"}}
|
|
<p>{{ printf "%#v" $currentPageGraph }}</p>
|
|
|
|
{{ $data := (dict "allPages" site.AllPages "currentPage" $currentPage)}}
|
|
{{- with (templates.Defer (dict "data" $data)) -}}
|
|
{{ range .allPages }}
|
|
{{- $page := . -}}
|
|
{{- $pageGraph := $page.Store.Get "graph" -}}
|
|
|
|
{{- range $child := index $pageGraph "has" -}}
|
|
{{- $childPage := site.GetPage $child -}}
|
|
{{- $isinPages := $childPage.Store.Get "isin" | default slice -}}
|
|
{{- $isinPages = $isinPages | append $page.RelPermalink -}}
|
|
{{- $childPage.Store.Set "isin" ($isinPages|uniq) -}}
|
|
{{- end -}}
|
|
|
|
{{- range $kid := index $pageGraph "no-prefix" -}}
|
|
{{- $mentionedInPage := site.GetPage $kid -}}
|
|
{{- $mentionedIn := $mentionedInPage.Store.Get "mentioned_in" | default slice -}}
|
|
{{- $mentionedIn = $mentionedIn | append $page.RelPermalink -}}
|
|
{{- $mentionedInPage.Store.Set "mentioned_in" ($mentionedIn|uniq) -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- printf "%s is in %#v" .currentPage.RelPermalink (.currentPage.Store.Get "isin") -}}
|
|
{{- printf "%s mentioned in %#v" .currentPage.RelPermalink (.currentPage.Store.Get "mentioned_in") -}}
|
|
{{- warnf "%s is in %#v" .currentPage.RelPermalink (.currentPage.Store.Get "isin") -}}
|
|
{{- warnf "%s mentioned in %#v" .currentPage.RelPermalink (.currentPage.Store.Get "mentioned_in") -}}
|
|
{{- end -}}
|