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- group: much like tree, but grouped by title, see example fer details- card: a card fer each top-level children |
| breadcrumb | false |
When true shows th' breadcrumb under each plank 'n th' list. |
| cardtemplate | default |
If type=card, th' template t' be used t' display a card. See below fer details. |
| 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=tree|list|flat 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. |
| headingdepth | 2 |
For type=group|list th' start'n depth o' th' head'n. |
| showhidden | false |
When true, child planks hidden from th' menu will be displayed as well. |
| sort | auto |
For type=tree|list|flat|card th' sort criteria o' th' displayed list. type=group be always sorted by title.- 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. |
Configurat'n
T' use this shortcode ye need t' en'ble block attributes 'n yer hugo.toml.
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
-
This be a plain plank test, an' th' beginn'n o' a YAML multiline description…
-
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
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
-
plank X
This be a plain plank test, an' th' beginn'n o' a YAML multiline description…
-
plank 1
This be a demo child plank
-
plank 1-1
This be a demo child plank
-
plank 1-1-2 (headless)
This be a demo child plank
-
plank 1-1-3
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
-
plank 3-1
This be a plain plank test nested 'n a parent
Flat Type wit' Depth
Group Type
P
-
This be a plain plank test, an' th' beginn'n o' a YAML multiline description…
-
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
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.
Details
Avast if ye want t' use th' card layout an' have goldmark.renderer.unsafe=false (which be th' default if ye don’t set it), ye have t' to use {{< children >}} instead o' {{% children %}} as wit' th' other examples.
-
This be a plain plank test, an' th' beginn'n o' a YAML multiline description…
-
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