Perf: add I18n support for echarts and timeline data param

This commit is contained in:
Cell
2025-04-29 16:50:09 +08:00
parent d1d3ed2954
commit 35413d613f
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
{{- .Scratch.Set "version" "v0.3.20-0cf0d4f4" -}}
{{- .Scratch.Set "version" "v0.3.20-d1d3ed29" -}}
{{- .Scratch.Set "this" dict -}}
{{- partial "init/detection-env.html" . -}}
+1 -1
View File
@@ -21,7 +21,7 @@
<template data-fmt="js" data-async="{{ $async }}">{{ $content | safeJS }}</template>
{{- else -}}
{{ with $data }}
{{- $content = index site.Data.echarts . -}}
{{- $content = index site.Data.echarts (printf "%v.%v" . page.Language) | default (index site.Data.echarts .) -}}
{{- if not $content -}}
{{- warnf "ECharts: data not found, please ensure the data file \"data/echarts/%s.{json|yml|yaml|toml}\" exists." . -}}
{{- end -}}
+1 -1
View File
@@ -10,7 +10,7 @@
{{- /* Get Timeline events */ -}}
{{- $content := .Inner -}}
{{ with $data }}
{{- $content = index site.Data.timeline . -}}
{{- $content = index site.Data.timeline (printf "%v.%v" . page.Language) | default (index site.Data.timeline .) -}}
{{- if not $content -}}
{{- warnf "Timeline: data not found, please ensure the data file \"data/timeline/%s.{json|yml|yaml|toml}\" exists." . -}}
{{- end -}}