fix: eliminate deprecation warnings with hugo version 0.156.0 (#702)

* Fix deprecation warning with latest hugo version 0.156.0

* fix: use `hugo.Data` to replace the discarded `.Site.Data`

* chore(hugo): update Hugo version requirements to 0.156.0

---------

Co-authored-by: Cell <1024@lruihao.cn>
This commit is contained in:
Andreas Deininger
2026-02-27 08:46:31 +01:00
committed by GitHub
parent 581d8373bf
commit 175cf888d5
15 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -24,7 +24,7 @@
<template data-fmt="js" data-async="{{ $async }}">{{ $content | safeJS }}</template>
{{- else -}}
{{ with $data }}
{{- $content = index site.Data.echarts (printf "%v.%v" . page.Language) | default (index site.Data.echarts .) -}}
{{- $content = index hugo.Data.echarts (printf "%v.%v" . page.Language) | default (index hugo.Data.echarts .) -}}
{{- if not $content -}}
{{- warnf "ECharts: data not found, please ensure the data file \"data/echarts/%s.{json|yml|yaml|toml}\" exists." . -}}
{{- end -}}