Welcome to mirror list, hosted at ThFree Co, Russian Federation.

compatibility.html « plugin « partials « layouts - github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b460f185f12cfa98a4bd0fef8d439fe5fd2ccfc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{{- $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=%v" | 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 -}}