Skip to content

Commit bdc84c8

Browse files
author
anmol372
committed
Added section-index to /partials dir
1 parent 96443c8 commit bdc84c8

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

layouts/docs/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{{ define "main" }}
22
{{ .Render "content" }}
3-
{{ end }}
3+
{{ end }}

layouts/partials/section-index.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<div class="section-index">
2+
{{ $pages := (where .Site.Pages "Section" .Section).ByWeight }}
3+
{{ $parent := .Page }}
4+
{{ if $parent.Params.no_list }}
5+
{{/* If no_list is true we don't show a list of subpages */}}
6+
{{ else if $parent.Params.simple_list }}
7+
{{/* If simple_list is true we show a bulleted list of subpages */}}
8+
<ul>
9+
{{ range $pages }}
10+
{{ if eq .Parent $parent }}
11+
<li><a href="{{ .RelPermalink }}">{{- .Title -}}</a></li>
12+
{{ end }}
13+
{{ end }}
14+
</ul>
15+
{{ else }}
16+
{{/* Otherwise we show a nice formatted list of subpages with page descriptions */}}
17+
<hr class="panel-line">
18+
{{ range $pages }}
19+
{{ if eq .Parent $parent }}
20+
<div class="entry">
21+
<h3>
22+
<a href="{{ .RelPermalink }}">{{- .Title -}}</a>
23+
</h3>
24+
<p>{{ .Description | markdownify }}</p>
25+
</div>
26+
{{ end }}
27+
{{ end }}
28+
{{ end }}
29+
</div>

themes/docsy/layouts/partials/section-index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
{{ range $pages }}
1919
{{ if eq .Parent $parent }}
2020
<div class="entry">
21-
<h3>
21+
<h5>
2222
<a href="{{ .RelPermalink }}">{{- .Title -}}</a>
23-
</h3>
23+
</h5>
2424
<p>{{ .Description | markdownify }}</p>
2525
</div>
2626
{{ end }}

0 commit comments

Comments
 (0)