dd vendored icons for the tour-map
All checks were successful
/ build (pull_request) Successful in 25s
All checks were successful
/ build (pull_request) Successful in 25s
This commit is contained in:
parent
14aed5e649
commit
2c28c050a5
933 changed files with 9891 additions and 22 deletions
20
layouts/_partials/tour-map-icon.html
Normal file
20
layouts/_partials/tour-map-icon.html
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{{- /*
|
||||
Returns a map icon as a data: URI, or "" if there is none by that name.
|
||||
The name is looked up in the vendored icon sets in assets/vendor/icons/, in the order
|
||||
osmic, maki, temaki; a prefix like "maki:garden" picks the set.
|
||||
*/ -}}
|
||||
{{- $name := . -}}
|
||||
{{- $sets := slice "osmic" "maki" "temaki" -}}
|
||||
{{- with findRESubmatch `^(osmic|maki|temaki):(.+)$` . 1 -}}
|
||||
{{- $sets = slice (index . 0 1) -}}
|
||||
{{- $name = index . 0 2 -}}
|
||||
{{- end -}}
|
||||
{{- $uri := "" -}}
|
||||
{{- range $sets -}}
|
||||
{{- if not $uri -}}
|
||||
{{- with resources.Get (printf "vendor/icons/%s/%s.svg" . $name) -}}
|
||||
{{- $uri = printf "data:image/svg+xml;base64,%s" ((. | minify).Content | base64Encode) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- return $uri -}}
|
||||
Loading…
Reference in a new issue