mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
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:
committed by
GitHub
parent
581d8373bf
commit
175cf888d5
@@ -1,4 +1,4 @@
|
||||
{{- $buildDrafts := .Site.BuildDrafts -}}
|
||||
{{- $buildDrafts := .Page.Draft -}}
|
||||
{{- $relLangURL := relLangURL "" -}}
|
||||
|
||||
{{- /* Desktop header */ -}}
|
||||
@@ -118,7 +118,7 @@
|
||||
</span>
|
||||
<ul class="sub-menu">
|
||||
{{- if (eq .Kind "404") -}}
|
||||
{{- range .Sites -}}
|
||||
{{- range hugo.Sites -}}
|
||||
{{- if ne . $.Site -}}
|
||||
{{- $link := printf "%v/404.html" .LanguagePrefix -}}
|
||||
<li class="menu-item">
|
||||
@@ -292,7 +292,7 @@
|
||||
</span>
|
||||
<select id="language-select" class="language-select" onchange="location = this.value;">
|
||||
{{- if eq .Kind "404" -}}
|
||||
{{- range .Sites -}}
|
||||
{{- range hugo.Sites -}}
|
||||
{{- $link := printf "%v/404.html" .LanguagePrefix -}}
|
||||
<option value="{{ $link }}"{{ if eq . $.Site }} selected disabled{{ end }}>
|
||||
{{- .Language.LanguageName -}}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
{{- if ne .Site.Params.dev.enable true -}}
|
||||
{{- .Site.Store.Set "devOpts" dict -}}
|
||||
{{- end -}}
|
||||
{{- if eq .Site .Sites.Default -}}
|
||||
{{- if eq .Site hugo.Sites.Default -}}
|
||||
{{- warnf "FixIt %v\n%v\n\n" (hugo.Store.Get "version") (T "init.devEnvWarn") -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
{{- end -}}
|
||||
|
||||
{{- /* FixIt theme version detection */ -}}
|
||||
{{- if eq .Site .Sites.Default -}}
|
||||
{{- if eq .Site hugo.Sites.Default -}}
|
||||
{{- if not .Site.Params.version -}}
|
||||
{{- errorf "FixIt %v\n%v\n\n" $version (T "init.configurationError") -}}
|
||||
{{- else if gt "0.2.0" (strings.TrimPrefix "v" .Site.Params.version) -}}
|
||||
|
||||
@@ -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 -}}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
{{- /* Get Timeline events */ -}}
|
||||
{{- $content := .Inner -}}
|
||||
{{ with $data }}
|
||||
{{- $content = index site.Data.timeline (printf "%v.%v" . page.Language) | default (index site.Data.timeline .) -}}
|
||||
{{- $content = index hugo.Data.timeline (printf "%v.%v" . page.Language) | default (index hugo.Data.timeline .) -}}
|
||||
{{- if not $content -}}
|
||||
{{- warnf "Timeline: data not found, please ensure the data file \"data/timeline/%s.{json|yml|yaml|toml}\" exists." . -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -89,9 +89,9 @@
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Site Data: load from data/filetree/ */ -}}
|
||||
{{- /* Hugo Data: load from data/filetree/ */ -}}
|
||||
{{- if $dataName | and (not $treeData) -}}
|
||||
{{- with index .Site.Data.filetree (printf "%v.%v" $dataName .Page.Language) | default (index .Site.Data.filetree $dataName) -}}
|
||||
{{- with index hugo.Data.filetree (printf "%v.%v" $dataName .Page.Language) | default (index hugo.Data.filetree $dataName) -}}
|
||||
{{- $treeData = . -}}
|
||||
{{- else -}}
|
||||
{{- $exts := delimit (apply $supportExts "trim" "." "\\.") "|" -}}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
{{- /* Friend links */ -}}
|
||||
<script src="//at.alicdn.com/t/font_578712_g26jo2kbzd5qm2t9.js" async defer></script>
|
||||
<div class="friend-links">
|
||||
{{ range $index, $friend := .Site.Data.friends }}
|
||||
{{ range $index, $friend := hugo.Data.friends }}
|
||||
<a class="friend-link" title="{{ $friend.description | safeHTML }}" href="{{ $friend.url | safeURL }}" rel="external noopener" target="_blank">
|
||||
{{ if $friend.avatar }}
|
||||
{{- dict "Src" $friend.avatar "Alt" $friend.nickname "Title" $friend.description "Class" "friend-avatar" | partial "plugin/image.html" -}}
|
||||
|
||||
Reference in New Issue
Block a user