mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
5322a15ceb
Add `{{/* ... */}}` header comments to 25 partials that had no documentation,
enabling `pnpm gen:docs` to generate their reference docs. Also fix
base/head/index.html leading blank line that prevented parser matching.
Groups covered: base/, feed/, function/, home/, init/, plugin/, single/, store/, (root).
30 lines
1.1 KiB
HTML
30 lines
1.1 KiB
HTML
{{- /*
|
|
Browser compatibility polyfills partial.
|
|
|
|
Conditionally loads polyfill.io and object-fit-images for older browsers
|
|
based on site compatibility configuration.
|
|
*/ -}}
|
|
|
|
{{- $compatibility := .Site.Params.compatibility | default dict -}}
|
|
{{- $cdn := .Site.Store.Get "cdn" | default dict -}}
|
|
{{- $fingerprint := .Site.Store.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://cdnjs.cloudflare.com/polyfill/v3/polyfill.js?features=%v" | dict "Source" | dict "Page" $ "Data" | partial "store/script.html" -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- /* object-fit-images */ -}}
|
|
{{- if $compatibility.object_fit -}}
|
|
{{- $source := $cdn.objectFitImagesJS | default "lib/object-fit-images/ofi.min.js" -}}
|
|
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Page" . "Data" | partial "store/script.html" -}}
|
|
{{- end -}}
|