refactor: migrate to new template system introduced in Hugo v0.146.0 (#1232)

See: https://gohugo.io/templates/new-templatesystem-overview/
This commit is contained in:
Jimmy
2026-01-25 22:42:00 +01:00
committed by GitHub
parent 633c8c6b9f
commit 5f1ab2bc76
71 changed files with 1 additions and 1 deletions
+29
View File
@@ -0,0 +1,29 @@
{{- $List := index .Context.Site.Data.external .Namespace -}}
{{- with $List -}}
{{- range . -}}
{{- if eq .type "script" -}}
<script
src="{{ .src }}"
{{- with .integrity -}}
integrity="{{ . }}"
{{- end -}}
crossorigin="anonymous"
{{ if .defer }}defer{{ end }}
>
</script>
{{- else if eq .type "style" -}}
<link
rel="stylesheet"
href="{{ .src }}"
{{- with .integrity -}}
integrity="{{ . }}"
{{- end -}}
crossorigin="anonymous"
>
{{- else -}}
{{- errorf "Error: unknown external resource type: %s" .type -}}
{{- end -}}
{{- end -}}
{{- else -}}
{{- errorf "Error: external resource '%s' is not found" .Namespace -}}
{{- end -}}