mirror of
https://github.com/docker/docs.git
synced 2026-03-27 14:28:47 +07:00
- layouts/partials/ → layouts/_partials/ - layouts/shortcodes/ → layouts/_shortcodes/ - layouts/_default/_markup/ → layouts/_markup/ - layouts/_default/*.html → layouts/*.html (flatten _default/) - layouts/index.html → layouts/home.html - layouts/index.*.json/txt → layouts/home.*.json/txt - layouts/_default/index.llms.txt → layouts/home.llms.txt - layouts/tag/ → layouts/tags/ (match /tags/ URL path)
22 lines
536 B
HTML
22 lines
536 B
HTML
{{- $icon := . -}}
|
|
|
|
{{- $svgPath := "" -}}
|
|
|
|
{{- if or (strings.HasSuffix $icon ".svg") (strings.HasPrefix $icon "icons/") }}
|
|
{{- $svgPath = $icon -}}
|
|
{{- else }}
|
|
{{- $svgPath = printf "icons/%s-fill.svg" $icon -}}
|
|
{{- end }}
|
|
|
|
{{- $svg := resources.Get $svgPath -}}
|
|
|
|
{{- if not $svg }}
|
|
{{- errorf "Failed to get icon: %v (resolved path: %s)\n\n" $icon $svgPath }}
|
|
{{- end }}
|
|
|
|
{{- if not $svg.Content }}
|
|
{{- errorf "Empty content for icon: %v (resolved path: %s)\n\n" $icon $svgPath }}
|
|
{{- end }}
|
|
|
|
{{- $svg.Content | safeHTML -}}
|