fix: replace deprecated .Site.Data with hugo.Data (#1322)
fix: replace deprecated .Site.Data with hugo.Data Use hugo.Data instead of deprecated .Site.Data (Hugo v0.156.0+)
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
{{- $opts := dict "minify" hugo.IsProduction "format" "esm" -}}
|
{{- $opts := dict "minify" hugo.IsProduction "format" "esm" -}}
|
||||||
{{- $galleryScript := resources.Get "ts/gallery.ts" | js.Build $opts -}}
|
{{- $galleryScript := resources.Get "ts/gallery.ts" | js.Build $opts -}}
|
||||||
|
|
||||||
{{ $style := .Site.Data.external.PhotoSwipe.Style }}
|
{{ $style := hugo.Data.external.PhotoSwipe.Style }}
|
||||||
{{ $core := .Site.Data.external.PhotoSwipe.Core }}
|
{{ $core := hugo.Data.external.PhotoSwipe.Core }}
|
||||||
{{ $lightbox := .Site.Data.external.PhotoSwipe.Lightbox }}
|
{{ $lightbox := hugo.Data.external.PhotoSwipe.Lightbox }}
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import gallery from '{{ $galleryScript.RelPermalink }}';
|
import gallery from '{{ $galleryScript.RelPermalink }}';
|
||||||
@@ -29,4 +29,4 @@
|
|||||||
});
|
});
|
||||||
lightbox.init();
|
lightbox.init();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{{- $List := index .Context.Site.Data.external .Namespace -}}
|
{{- $List := index hugo.Data.external .Namespace -}}
|
||||||
{{- with $List -}}
|
{{- with $List -}}
|
||||||
{{- range . -}}
|
{{- range . -}}
|
||||||
{{- if eq .type "script" -}}
|
{{- if eq .type "script" -}}
|
||||||
@@ -26,4 +26,4 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- errorf "Error: external resource '%s' is not found" .Namespace -}}
|
{{- errorf "Error: external resource '%s' is not found" .Namespace -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user