Files
docker-docs/layouts/partials/icon.html
Craig Osterhout 983d541636 dhi: add initial docs (#22852)
<!--Delete sections as needed -->

## Description

Add initial DHI docs

## Related issues or tickets

ENGDOCS- 22650

## Reviews

<!-- Notes for reviewers here -->
<!-- List applicable reviews (optionally @tag reviewers) -->

- [ ] Technical review
- [ ] Editorial review
- [ ] Product review

---------

Signed-off-by: Craig <craig.osterhout@docker.com>
2025-06-16 22:06:49 +01:00

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 -}}