From ed19b539b7f4facb6b49fa8b5ed53021b2d34295 Mon Sep 17 00:00:00 2001 From: virat-k82 Date: Wed, 1 Apr 2026 21:17:07 +0530 Subject: [PATCH 1/2] fix: replace deprecated Hugo site accessors Signed-off-by: virat-k82 --- layouts/partials/feature-info.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/feature-info.html b/layouts/partials/feature-info.html index 97be0ec00..b3dc57902 100644 --- a/layouts/partials/feature-info.html +++ b/layouts/partials/feature-info.html @@ -1,5 +1,5 @@ {{ $currentPage := .Page.Permalink }} -{{ $features := .Site.Data.feature_data }} +{{ $features := site.Data.feature_data }} {{ if not $features }} {{ with readFile "data/feature_data.json" }} {{ $features = . | transform.Unmarshal }} From b30b042c059f10476fef1c68b4f21faf0cf18a78 Mon Sep 17 00:00:00 2001 From: virat-k82 Date: Thu, 2 Apr 2026 23:35:37 +0530 Subject: [PATCH 2/2] fix: replace deprecated .Site.Data with hugo.Data and .Site.AllPages with site.AllPages Signed-off-by: virat-k82 --- assets/json/offline-search-index.json | 18 ++++++++++++++++++ layouts/_default/sitemap.xml | 2 +- layouts/partials/feature-info.html | 2 +- layouts/partials/recent-discussions.html | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 assets/json/offline-search-index.json diff --git a/assets/json/offline-search-index.json b/assets/json/offline-search-index.json new file mode 100644 index 000000000..1ee051c64 --- /dev/null +++ b/assets/json/offline-search-index.json @@ -0,0 +1,18 @@ +{{- $.Scratch.Add "offline-search-index" slice -}} +{{- range where site.AllPages ".Params.exclude_search" "!=" true -}} +{{- /* We have to apply `htmlUnescape` again after `truncate` because `truncate` applies `html.EscapeString` if the argument is not HTML. */ -}} +{{- /* Individual taxonomies can be added in the next line by add '"taxonomy-name" (.Params.taxonomy-name | default "")' to the dict (as seen for categories and tags). */ -}} +{{- $.Scratch.Add + "offline-search-index" + (dict + "ref" .RelPermalink + "title" .Title + "categories" (.Params.categories | default "") + "tags" (.Params.tags | default "") + "description" (.Description | default "") + "body" (.Plain | htmlUnescape) + "excerpt" ((.Description | default .Plain) | htmlUnescape | truncate (.Site.Params.offlineSearchSummaryLength | default 70) | htmlUnescape) + ) +-}} +{{- end -}} +{{- $.Scratch.Get "offline-search-index" | jsonify -}} diff --git a/layouts/_default/sitemap.xml b/layouts/_default/sitemap.xml index 8dd70da7a..831681511 100644 --- a/layouts/_default/sitemap.xml +++ b/layouts/_default/sitemap.xml @@ -1,7 +1,7 @@ {{ printf "" | safeHTML }} - {{ range .Site.AllPages }} + {{ range site.AllPages }} {{- if and (not .Params.sitemap_exclude) (not .Draft) }} {{ .Permalink }} diff --git a/layouts/partials/feature-info.html b/layouts/partials/feature-info.html index b3dc57902..c37848641 100644 --- a/layouts/partials/feature-info.html +++ b/layouts/partials/feature-info.html @@ -1,5 +1,5 @@ {{ $currentPage := .Page.Permalink }} -{{ $features := site.Data.feature_data }} +{{ $features :=hugo.Data.feature_data }} {{ if not $features }} {{ with readFile "data/feature_data.json" }} {{ $features = . | transform.Unmarshal }} diff --git a/layouts/partials/recent-discussions.html b/layouts/partials/recent-discussions.html index 3289f8f2a..479dfe087 100644 --- a/layouts/partials/recent-discussions.html +++ b/layouts/partials/recent-discussions.html @@ -1,7 +1,7 @@ {{ if eq .Section "kanvas" }}

Recent Discussions on Kanvas

    - {{ with site.Data.kanvas_discuss }} + {{ with hugo.Data.kanvas_discuss }} {{ $users := .users }} {{ $topics := sort .topic_list.topics "last_posted_at" "desc" }}