mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
Icons in docs/assets/icons/, one SVG each (12x12 viewBox, one path,
fill="currentColor", shape-rendering="crispEdges"):
- From Dinkie Icons 0.4.6 (MIT, the @dinkie-icons/react package's path
data; LICENSE kept): rocket, wrench, shield, locked,
three-networked-computers, cube, code, gear, brand-github, hammer,
brand-apple, flask, check-mark-circled, cross-mark-button,
diagonal-cross, information-circled, no-entry, view-grid,
speech-balloon-question, ghost, question-face, robot, file-folder,
globe-with-meridians, copies.
- Drawn in the same grid and line weight: penguin (Linux), prompt (>_),
warning (a triangle with !).
{{< icon "name" >}} (and {{< icon "name" "Label" >}}) inlines one through
the icon partial: class devvm-icon, aria-hidden without a label, role=img
and aria-label with one; an unknown name fails the build. custom.css sizes
it 0.75em square on the baseline, so a pixel is one screen pixel in 16px
text. Contributing > Writing docs covers the source, license, shortcode
and adding one.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
13 lines
728 B
HTML
13 lines
728 B
HTML
{{- /* A pixel icon from assets/icons/, inlined so it takes the text's color and size. Takes its name, an
|
|
optional label and the calling shortcode's position, for the error. Without a label, screen readers skip
|
|
it; with one, they read the label. */ -}}
|
|
{{- with resources.Get (printf "icons/%s.svg" .name) -}}
|
|
{{- $attrs := `class="devvm-icon" aria-hidden="true" focusable="false"` -}}
|
|
{{- with $.label -}}
|
|
{{- $attrs = printf `class="devvm-icon" role="img" aria-label="%s" focusable="false"` (. | htmlEscape) -}}
|
|
{{- end -}}
|
|
{{- replace (trim .Content "\n") "<svg " (printf "<svg %s " $attrs) 1 | safeHTML -}}
|
|
{{- else -}}
|
|
{{- errorf "icon: no docs/assets/icons/%s.svg (%s)" .name .position -}}
|
|
{{- end -}}
|