{{- $name := .Get "diagram" -}} {{- $id := printf "rollout-%s-%d" $name .Ordinal -}} {{- $asset := resources.Get (printf "rollouts/%s.svg" $name) -}} {{- if not $asset -}} {{- errorf "Missing rollout diagram %q on %s" $name .Page.File.Path -}} {{- end -}} {{- $svg := replaceRE `<\?xml[^>]*\?>` "" $asset.Content -}} {{- $simple := strings.Contains $asset.Content `class="algorithm-flow"` -}} {{/* Each original has its own glyph/clip IDs. Namespace them before inlining. */}} {{- $svg = replaceRE `id="([^"]+)"` (printf `id="%s-${1}"` $id) $svg -}} {{- $svg = replace $svg `href="#` (printf `href="#%s-` $id) -}} {{- $svg = replace $svg `url(#` (printf `url(#%s-` $id) -}} {{- $svg = replace $svg `
{{ .Get "title" }} {{ .Get "description" }}
{{ $svg | safeHTML }}