Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_index.md « children « shortcodes « content « exampleSite - github.com/vjeantet/hugo-theme-docport.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6d253e781923d8ffa44578cf1db074d1720e6c88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
description: List the child pages of a page
title: children
---


Use the children shortcode to list the child pages of a page and the further descendants (children's children). By default, the shortcode displays links to the child pages.

## Usage

| Parameter | Default | Description |
|:--|:--|:--|
| page | _current_ | Specify the page name (section name) to display children for |
| style | "li" | Choose the style used to display descendants. It could be any HTML tag name, use "card" to display children pages as cards |
| showhidden | "false" | When true, child pages hidden from the menu will be displayed |
| description  | "false" | Allows you to include a short text under each page in the list.<br/>when no description exists for the page, children shortcode takes the first 70 words of your content. [read more info about summaries on gohugo.io](https://gohugo.io/content/summaries/)  |
| depth | 1 | Enter a number to specify the depth of descendants to display. For example, if the value is 2, the shortcode will display 2 levels of child pages. {{%alert success%}}**Tips:** set 999 to get all descendants{{%/alert%}}|
| sort | none | Sort Children By<br><li><strong>Weight</strong> - to sort on menu order</li><li><strong>Name</strong> - to sort alphabetically on menu label</li><li><strong>Identifier</strong> - to sort alphabetically on identifier set in frontmatter</li><li><strong>URL</strong> - URL</li> |



## Demo
```    
	{{%/* children  */%}}
```    
{{%children %}}
```    
	{{%/* children description="true"   */%}}
```    
{{%children description="true"   %}}
```    
	{{%/* children depth="3" showhidden="true" */%}}
```    
{{% children depth="3" showhidden="true" %}}
```    
	{{%/* children style="h2" depth="3" description="true" */%}}
```    
{{% children style="h2" depth="3" description="true" %}}
```    
	{{%/* children style="div" depth="999" */%}}
```    
{{% children style="div" depth="999" %}}
```    
	{{%/* children style="card" depth="2"  description="true" */%}}
```    
{{% children style="card" depth="2" description="true" %}}