{{- /* A download on the branding page: a preview on its background, a title, then a link for each file. {{< brand-asset title="On dark backgrounds" src="branding/devvm-logo-on-dark.svg" bg="dark" width="250" height="86" alt="…" files="branding/devvm-logo-on-dark.svg branding/devvm-logo-on-dark.png" >}} src and files are paths in docs/static/. bg is dark (black) or light (white). width and height are the preview's size in CSS pixels, a whole multiple of the image's, so its pixels stay sharp; without them, the preview is as wide as its tile. Each link is the file's type, and a PNG's size, which the build reads from the file. The build fails when a file doesn't exist. */ -}} {{- $src := .Get "src" -}} {{- $files := split (.Get "files") " " -}} {{- range $files -}} {{- if not (fileExists (printf "static/%s" .)) }}{{ errorf "brand-asset: no docs/static/%s (%s)" . $.Position }}{{ end -}} {{- end -}} {{- if not (fileExists (printf "static/%s" $src)) }}{{ errorf "brand-asset: no docs/static/%s (%s)" $src .Position }}{{ end -}}
{{ .Get
{{ .Get "title" }}