mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
The two templates that read the sections' icons used site.Data, which Hugo 0.156 deprecated; the built site is the same with hugo.Data. lint:docs builds the site with --panicOnWarning into a temporary folder, so the next deprecation fails there. The site's description says one VM for every project. Co-Authored-By: Claude Opus 5.5 <[email protected]>
20 lines
1.1 KiB
HTML
20 lines
1.1 KiB
HTML
{{- /* 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<span>%s</span>" (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 -}}
|