SandpointsTheme/layouts/partials/graph-menu.html

26 lines
803 B
HTML
Raw Normal View History

2025-04-18 12:05:39 +02:00
{{- $cursiveMenuPrefix := .cursiveMenuPrefix -}}
{{- $menuSection := .menuSection -}}
{{- $pagePaths := .pagePaths -}}
2025-05-04 15:11:06 +02:00
{{- $class := .class -}}
<div class="graph-menu{{- $class -}}">
2025-04-18 12:05:39 +02:00
<div class="graph-inline-cursive">
{{- with $cursiveMenuPrefix -}}{{- . -}}&nbsp;{{- end -}}
2025-04-20 00:01:16 +02:00
{{- if gt ($pagePaths|len) 1 -}}
{{- partial "GetPluralSectionName.html" $menuSection -}}
{{- else -}}
{{- $menuSection -}}
{{- end -}}
2025-04-18 12:05:39 +02:00
</div>
<div class="graph-inline-link">
{{- range $pagePaths -}}
{{- $p := site.GetPage . -}}
{{- $pageSection := trim $p.FirstSection.RelPermalink "//" -}}
{{- if eq $pageSection $menuSection -}}
<div>
<a href="{{- $p.RelPermalink -}}">{{- $p.LinkTitle -}}</a>
</div>
{{- end -}}
{{- end -}}
</div>
</div>