Children
Th' children shortcode lists child planks 'n various layouts.
Usage
Parameter
| Name | Default | Notes |
|---|---|---|
| type | tree |
Th' layout used fer th' list'n. - tree: a nested, unordered list- list: a non-nested list wit' titles resembl'n a head'n style depend'n on th' depth- flat: a non-nested list wit' titles 'n standard text style- card: a card fer each top-level children. |
| showhidden | false |
When true, child planks hidden from th' menu will be displayed as well. |
| descript'n | false |
When true shows a short text under each plank 'n th' list. When no descript'n or summary exists fer th' plank, th' first 70 words o' th' rrrambl'n be taken - read more info about summaries on gohugo.io. |
| image | true |
For type=card decides whether t' put an image on th' card. See below fer details. |
| depth | 1 |
For type!=card th' depth o' descendants t' display. For example, if th' value be 2, th' shortcode will display two levels o' child planks. T' get all descendants, set this value t' a high number eg. 999. |
| sort | auto |
Th' sort criteria o' th' displayed list. - auto defaults t' ordersectionsby o' th' page’s Front Matteror t' ordersectionsby o' th' configurat'n Opt'nor t' default- weight- title- modifieddate- expirydate- publishdate- date- length- default adher'n t' Hugo’s default sort criteria. |
| cardtemplate | default |
If type=card, th' template t' be used t' display a card. See below fer details. |
Remarks fer th' Card Type
Th' card type uses th' cards shortcode t' display th' top-level children o' a plank. See below fer an example.
Each children be displayed 'n its own card, us'n th' default cardtemplate. Wit' it th' card will display
- if
image=truea featured image at th' start selected by Cap'n Hugo - th' title o' th' child plank as card title
- if
description=trueth' summary
If ye have advanced requirements, ye can write yer own cardtemplate.
Own Card Templates
Th' children shortcode displays each children us'n th' card shortcode fer display. If ye have advanced requirements t' display th' children, ye can place a card layout partial into layouts/partials/card.
For example, if ye want t' see debug output display'n th' parameter th' partial receives, ye could set cardtemplate=debug which will cause th' partial layouts/partials/debug.html t' be called. Th' debug card template be shipped wit' th' theme.
A card template will be called wit' th' follow'n parameter by th' children shortcode:
plank: th' plank, th'childrenshortcode was contained 'nrrrambl'n: th' summaryhref: ready t' use link t' th' children plankimage: ready t' use link t' th' featured imagetitle: title o' th' children plankparams.page: th' children plankparams.depth: th' shorrrtcodesdepthparameter valueparams.descript'n: th' shorrrtcodesdescript'nparameter valueparams.showhidden: th' shorrrtcodesshowhiddenparameter valueparams.sort: th' shorrrtcodessortparameter value
Examples
All Default
Wit' Descript'n
- plank X
This be a plain plank test, an' th' beginn'n o' a YAML multiline descript'n...
- plank 1
This be a demo child plank
- plank 2
This be a demo child plank wit' no descript'n. So its rrrambl'n be used as descript'n.
- plank 3
This be a demo child plank
Infinite Depth an' Hidden Planks
- plank X
- plank 1
- plank 1-1
- plank 1-1-1 (hidden)
- plank 1-1-2 (headless)
- plank 1-1-3
- plank 1-1
- plank 2
- plank 3
- plank 4 (hidden)
List Type wit' Depth an' Descript'n
This be a plain plank test, an' th' beginn'n o' a YAML multiline descript'n...
This be a demo child plank
This be a demo child plank
This be a demo child plank
This be a demo child plank
This be a demo child plank wit' no descript'n. So its rrrambl'n be used as descript'n.
This be a demo child plank
This be a plain plank test nested 'n a parent
Flat Type wit' Depth
Card Type wit' Descript'n
Because none o' th' children planks o' this example define their own feature images, th' theme (and Hugo) falls back t' th' media image o' yer ship.