From 39ccc51610d96bad535e08924d02bfec9018ab4b Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Sun, 13 Oct 2024 12:27:22 +0800 Subject: [PATCH] :zap: Chore: code optimization --- layouts/partials/init/index.html | 2 +- layouts/partials/single/collection-list.html | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html index df7d2e35..8237f857 100644 --- a/layouts/partials/init/index.html +++ b/layouts/partials/init/index.html @@ -1,4 +1,4 @@ -{{- .Scratch.Set "version" "v0.3.13-9471b94b" -}} +{{- .Scratch.Set "version" "v0.3.13-581466fd" -}} {{- .Scratch.Set "this" dict -}} {{- partial "init/detection-env.html" . -}} diff --git a/layouts/partials/single/collection-list.html b/layouts/partials/single/collection-list.html index a23414c7..2f0694f2 100644 --- a/layouts/partials/single/collection-list.html +++ b/layouts/partials/single/collection-list.html @@ -21,12 +21,14 @@ {{- range $key, $page := $pages -}} {{- $capitalizeTitles := $page.Param "capitalizeTitles" -}} {{- $title := cond $capitalizeTitles (title $page.LinkTitle) $page.LinkTitle -}} - {{- if $page.LinkTitle | eq $.LinkTitle -}} - {{- $currentKey = $key -}} -
  • {{ $title }}
  • - {{- else }} -
  • {{ $title }}
  • - {{- end }} +
  • + {{- if $.Eq $page -}} + {{- $currentKey = $key -}} + {{ $title }} + {{- else -}} + {{ $title }} + {{- end -}} +
  • {{- end -}}