Chore: code optimization

This commit is contained in:
Cell
2024-10-13 12:27:22 +08:00
parent 581466fd25
commit 39ccc51610
2 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -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" . -}}
+8 -6
View File
@@ -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 -}}
<li class="collection-item"><span class="active" title="{{ $title }}">{{ $title }}</span></li>
{{- else }}
<li class="collection-item"><a href="{{ $page.RelPermalink }}" title="{{ $title }}">{{ $title }}</a></li>
{{- end }}
<li class="collection-item">
{{- if $.Eq $page -}}
{{- $currentKey = $key -}}
<span class="active" title="{{ $title }}">{{ $title }}</span>
{{- else -}}
<a href="{{ $page.RelPermalink }}" title="{{ $title }}">{{ $title }}</a>
{{- end -}}
</li>
{{- end -}}
</ul>
<div class="collection-nav-simple">