mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-15 11:33:20 +01:00
23 lines
985 B
HTML
23 lines
985 B
HTML
|
{{- $compatibility := .Site.Params.compatibility | default dict -}}
|
||
|
{{- $cdn := .Scratch.Get "cdn" | default dict -}}
|
||
|
{{- $fingerprint := .Scratch.Get "fingerprint" -}}
|
||
|
|
||
|
{{- /* Polyfill.io */ -}}
|
||
|
{{- if $compatibility.polyfill -}}
|
||
|
{{- $features := slice -}}
|
||
|
{{- range resources.Get "data/polyfill.yml" | transform.Unmarshal -}}
|
||
|
{{- range . -}}
|
||
|
{{- $features = $features | append . -}}
|
||
|
{{- end -}}
|
||
|
{{- end -}}
|
||
|
{{- with $features | uniq -}}
|
||
|
{{- delimit . "%2C" | printf "https://polyfill.io/v3/polyfill.min.js?features=%s" | dict "source" | dict "scratch" $.Scratch "data" | partial "scratch/script.html" -}}
|
||
|
{{- end -}}
|
||
|
{{- end -}}
|
||
|
|
||
|
{{- /* object-fit-images */ -}}
|
||
|
{{- if $compatibility.objectFit -}}
|
||
|
{{- $source := $cdn.objectFitImagesJS | default "lib/object-fit-images/ofi.min.js" -}}
|
||
|
{{- dict "source" $source "fingerprint" $fingerprint | dict "scratch" .Scratch "data" | partial "scratch/script.html" -}}
|
||
|
{{- end -}}
|