♻️ Refactor: global/site/page scope state management (#610)

*  Perf: adjust global/site scope state management

*  Perf: adjust page scope state management
This commit is contained in:
Cell
2025-07-03 12:34:28 +08:00
parent d9043280fe
commit 3e8bdfd8f9
42 changed files with 165 additions and 173 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
<html itemscope itemtype="http://schema.org/WebPage" lang="{{ .Site.LanguageCode }}">
<head>
{{ if .IsHome | and (ne .Site.Params.disableThemeInject true) }}
<meta name="theme" content='FixIt {{ .Scratch.Get "version" }}'>
<meta name="theme" content='FixIt {{ hugo.Store.Get "version" }}'>
{{ end }}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
@@ -25,7 +25,7 @@
<div class="wrapper" data-page-style="{{ (partial `function/params.html`).pageStyle | default `normal` }}">
{{- partial "header.html" . -}}
{{- partial "breadcrumb.html" . -}}
{{- $toc := .Scratch.Get "toc" -}}
{{- $toc := .Store.Get "toc" -}}
<main class="container{{ if (eq $toc.enable true) | and (eq $toc.position `left`) }} container-reverse{{ end }}">
{{- block "content" . }}{{ end -}}
</main>