From 66b9cdb0f316ad05eae1830893d19fa7f4c29459 Mon Sep 17 00:00:00 2001 From: ruinivist Date: Mon, 22 Jun 2026 20:20:41 +0000 Subject: [PATCH] feat: highlight current page --- themes/starless/layouts/partials/explorer-tree.html | 11 ++++++----- themes/starless/layouts/partials/sidebar.html | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/themes/starless/layouts/partials/explorer-tree.html b/themes/starless/layouts/partials/explorer-tree.html index 078bf12..fc4f2f7 100644 --- a/themes/starless/layouts/partials/explorer-tree.html +++ b/themes/starless/layouts/partials/explorer-tree.html @@ -1,14 +1,15 @@ {{- range .nodes.ByWeight -}} + {{- $isCurrent := eq .RelPermalink $.currentPage.RelPermalink -}} {{- if eq $.level 0 -}}
- + {{ if .IsSection }}expand_more{{ else }}chevron_right{{ end }} {{ .LinkTitle }} {{- if .IsSection -}} {{- with .Pages.ByWeight -}}
- {{ partial "explorer-tree.html" (dict "nodes" . "level" (add $.level 1)) }} + {{ partial "explorer-tree.html" (dict "nodes" . "level" (add $.level 1) "currentPage" $.currentPage) }}
{{- end -}} {{- end -}} @@ -16,18 +17,18 @@ {{- else -}} {{- if .IsSection -}}
- + expand_more {{ .LinkTitle }} {{- with .Pages.ByWeight -}}
- {{ partial "explorer-tree.html" (dict "nodes" . "level" (add $.level 1)) }} + {{ partial "explorer-tree.html" (dict "nodes" . "level" (add $.level 1) "currentPage" $.currentPage) }}
{{- end -}}
{{- else -}} - {{ .LinkTitle }} + {{ .LinkTitle }} {{- end -}} {{- end -}} {{- end -}} diff --git a/themes/starless/layouts/partials/sidebar.html b/themes/starless/layouts/partials/sidebar.html index 8eacfc8..ca27d4f 100644 --- a/themes/starless/layouts/partials/sidebar.html +++ b/themes/starless/layouts/partials/sidebar.html @@ -10,7 +10,7 @@