Skip to content

Commit 789826f

Browse files
committed
Auto-generate child page indexes
This way when folks browse to the index pages they'll see an auto-generated list of child pages. Signed-off-by: Nic Cope <[email protected]>
1 parent d71867d commit 789826f

File tree

8 files changed

+31
-1
lines changed

8 files changed

+31
-1
lines changed

content/master/composition/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ title: Composition
33
weight: 51
44
description: Understand Crossplane's core components
55
---
6+
7+
{{< auto-index >}}

content/master/get-started/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ weight: 40
44
description: Get started with Crossplane.
55
---
66

7+
{{< auto-index >}}

content/master/guides/_index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
title: Guides
33
weight: 100
44
description: Crossplane integrations and detailed examples.
5-
---
5+
---
6+
7+
{{< auto-index >}}

content/master/managed-resources/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ title: Managed Resources
33
weight: 52
44
description: Understand Crossplane's managed resources and selective activation
55
---
6+
7+
{{< auto-index >}}

content/master/operations/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ state: alpha
55
alphaVersion: 2.0
66
description: Understand Crossplane's Operations feature
77
---
8+
9+
{{< auto-index >}}

content/master/packages/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ title: Packages
33
weight: 53
44
description: Understand Crossplane's core components
55
---
6+
7+
{{< auto-index >}}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{/*
2+
Auto-generates an index page with links to child pages, ordered by weight.
3+
Usage: {{ partial "auto-index" . }}
4+
*/}}
5+
{{ if .RegularPages }}
6+
<div class="auto-index">
7+
<p>Topics in this section:</p>
8+
<ul>
9+
{{ range .RegularPages.ByWeight }}
10+
<li><a href="{{ .Permalink }}">{{ .Title }}</a>{{ if .Params.description }} - {{ .Params.description }}{{ end }}</li>
11+
{{ end }}
12+
</ul>
13+
</div>
14+
{{ end }}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{/*
2+
Shortcode to auto-generate an index of child pages.
3+
Usage: {{< auto-index >}}
4+
*/}}
5+
{{ partial "auto-index" .Page }}

0 commit comments

Comments
 (0)