forked from drowl87/hextra_mirror
chore: move inline template to partial
This commit is contained in:
13
layouts/partials/sidebar/render-tree.html
Normal file
13
layouts/partials/sidebar/render-tree.html
Normal file
@ -0,0 +1,13 @@
|
||||
{{- $context := .context -}}
|
||||
{{- $page := .page -}}
|
||||
{{- $pageLink := .page.RelPermalink -}}
|
||||
{{- range .tree -}}
|
||||
{{- $active := eq $pageLink .link -}}
|
||||
{{- $shouldOpen := or (.open) (hasPrefix $pageLink .link) $active | default true }}
|
||||
<li class="{{ if $shouldOpen }}open{{ end }}">
|
||||
{{- template "sidebar-item-link" (dict "context" . "active" $active "title" .title "link" .link) -}}
|
||||
{{- if .section -}}
|
||||
{{- partial "sidebar/render-tree-branch" (dict "context" $context "entry" .section "page" $page) -}}
|
||||
{{- end -}}
|
||||
</li>
|
||||
{{ end }}
|
Reference in New Issue
Block a user