From 9ddd11797bbe96ef2bc4575792b1b51232210b87 Mon Sep 17 00:00:00 2001 From: powerfullz <61956140+powerfullz@users.noreply.github.com> Date: Sun, 26 Apr 2026 19:16:38 +0800 Subject: [PATCH] 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+) --- layouts/_partials/article/components/photoswipe.html | 8 ++++---- layouts/_partials/helper/external.html | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/layouts/_partials/article/components/photoswipe.html b/layouts/_partials/article/components/photoswipe.html index 475a4d0..1694a9f 100644 --- a/layouts/_partials/article/components/photoswipe.html +++ b/layouts/_partials/article/components/photoswipe.html @@ -1,9 +1,9 @@ {{- $opts := dict "minify" hugo.IsProduction "format" "esm" -}} {{- $galleryScript := resources.Get "ts/gallery.ts" | js.Build $opts -}} -{{ $style := .Site.Data.external.PhotoSwipe.Style }} -{{ $core := .Site.Data.external.PhotoSwipe.Core }} -{{ $lightbox := .Site.Data.external.PhotoSwipe.Lightbox }} +{{ $style := hugo.Data.external.PhotoSwipe.Style }} +{{ $core := hugo.Data.external.PhotoSwipe.Core }} +{{ $lightbox := hugo.Data.external.PhotoSwipe.Lightbox }} \ No newline at end of file + diff --git a/layouts/_partials/helper/external.html b/layouts/_partials/helper/external.html index 88d9525..cd0e1fd 100644 --- a/layouts/_partials/helper/external.html +++ b/layouts/_partials/helper/external.html @@ -1,4 +1,4 @@ -{{- $List := index .Context.Site.Data.external .Namespace -}} +{{- $List := index hugo.Data.external .Namespace -}} {{- with $List -}} {{- range . -}} {{- if eq .type "script" -}} @@ -26,4 +26,4 @@ {{- end -}} {{- else -}} {{- errorf "Error: external resource '%s' is not found" .Namespace -}} -{{- end -}} \ No newline at end of file +{{- end -}}