Skip to content

Commit 2ad35b5

Browse files
committed
style: minor changes
1 parent 8a6403b commit 2ad35b5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

layouts/partials/hb/modules/docs/section.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h1 class="hb-docs-doc-title mb-0">{{ .Title }}</h1>
99
{{ .Content }}
1010
{{- if .Pages }}
1111
<h2 class="mb-3">{{ i18n "in_this_section" }}</h2>
12-
<ul class="list-unstyled mb-5 border-top pt-3">
12+
<ul class="list-unstyled border-top pt-3">
1313
{{ template "walk-docs-section-tree" . }}
1414
</ul>
1515
{{- end }}
@@ -20,9 +20,11 @@ <h2 class="mb-3">{{ i18n "in_this_section" }}</h2>
2020
{{- define "walk-docs-section-tree" }}
2121
{{- $weighted := sort (where .Pages "Params.nav_weight" ">" 0) "Params.nav_weight" }}
2222
{{- $pages := union $weighted (sort .Pages "Title") }}
23-
{{- range $pages }}
23+
{{- range $i, $page := $pages }}
24+
{{- $last := eq (add $i 1) (len $pages) }}
2425
{{- if .IsSection }}
25-
<li class="mb-4">
26+
<li
27+
{{ if not $last }}class="mb-4"{{ end }}>
2628
<a class="fs-6 text-decoration-none" href="{{ .RelPermalink }}">
2729
{{- .Title -}}
2830
</a>
@@ -32,7 +34,8 @@ <h2 class="mb-3">{{ i18n "in_this_section" }}</h2>
3234
</ul>
3335
</li>
3436
{{- else }}
35-
<li class="mb-4">
37+
<li
38+
{{ if not $last }}class="mb-4"{{ end }}>
3639
<a class="fs-6 text-decoration-none" href="{{ .RelPermalink }}">
3740
{{- .Title -}}
3841
</a>

0 commit comments

Comments
 (0)