{{- /* A card for one section of the docs, on Hextra's card, inside Hextra's cards shortcode: the section's pixel icon, from data/sections.yaml, before the section's title, which links to it, then its one-line Markdown. {{< section-card path="getting-started" >}}Installing, …{{< /section-card >}} The path is under docs/, and the build fails when no page has it or the list has no icon for it. Hextra's card takes an icon only from its own set, so ours goes in its title, where the title's flex row spaces them the same. */ -}} {{- $path := .Get "path" -}} {{- $icon := index hugo.Data.sections $path -}} {{- if not $icon }}{{ errorf "section-card: data/sections.yaml has no icon for %s (%s)" $path .Position }}{{ end -}} {{- with site.GetPage (printf "/docs/%s" $path) -}} {{- $title := printf "%s%s" (partial "icon.html" (dict "name" $icon "position" $.Position)) (.LinkTitle | htmlEscape) -}} {{- partial "shortcodes/card" (dict "page" $.Page "link" .RelPermalink "title" ($title | safeHTML) "subtitle" (trim $.Inner "\n")) -}} {{- else -}} {{- errorf "section-card: no page docs/%s (%s)" $path .Position -}} {{- end -}}