mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 16:27:33 -10:00
/branding/ (content/branding.md, layouts/branding.html: Hextra's home layout with the home page's look, out of the sidebar): the logo as box-drawing text in a code block with Hextra's copy button; the logo as pixel SVGs for dark and light backgrounds, with 4x PNGs (static/branding/); the app icon as SVG and PNG at 64 to 1024, plus the site's existing icons; the social card; the palette as click-to-copy swatches (data/palette.yaml, hexes read from custom.css); the fonts with samples and Departure Mono's license; usage notes; credits. Shortcodes: brand-assets, brand-asset (fails the build on a missing file, reads PNG sizes), palette, font-sample. custom.css: the page's styles, the footer, and --devvm-accent-dark (#408000), the light logo's prompt. custom/footer.html: a footer link to the page on every page, and a contextmenu handler on the navbar logo that opens it. Contributing > Writing docs describes the page, its shortcodes and how to render its PNGs again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
22 lines
1.2 KiB
HTML
22 lines
1.2 KiB
HTML
{{- /* The branding page's palette: a swatch for each color in data/palette.yaml, with its hex, read from
|
|
assets/css/custom.css, and its CSS variable. Clicking a swatch copies its hex (the script is in
|
|
layouts/branding.html). The build fails when custom.css has no such variable. */ -}}
|
|
{{- $css := (resources.Get "css/custom.css").Content -}}
|
|
<ul class="devvm-swatches">
|
|
{{- range hugo.Data.palette }}
|
|
{{- $var := printf "--devvm-%s" .var }}
|
|
{{- $found := findRESubmatch (printf `%s:\s*(#[0-9a-fA-F]{6});` $var) $css 1 }}
|
|
{{- if not $found }}{{ errorf "data/palette.yaml: no %s with a hex in assets/css/custom.css (%s)" $var $.Position }}{{ end }}
|
|
{{- $hex := index (index $found 0) 1 | lower }}
|
|
<li>
|
|
<button type="button" class="devvm-swatch" data-copy="{{ $hex }}" aria-label="{{ .name }}, {{ $hex }}: copy the hex">
|
|
<span class="devvm-swatch-color" style="background-color: {{ $hex | safeCSS }}"></span>
|
|
<span class="devvm-swatch-name">{{ .name }}<span class="devvm-swatch-state" aria-live="polite">copy</span></span>
|
|
<code>{{ $hex }}</code>
|
|
<code>{{ $var }}</code>
|
|
<span class="devvm-swatch-use">{{ .use }}</span>
|
|
</button>
|
|
</li>
|
|
{{- end }}
|
|
</ul>
|