chore(debug)!: enable debug mode based on environment and remove params.dev.debug config

This commit is contained in:
Cell
2026-04-12 13:49:21 +08:00
parent 5f100a6cca
commit aef8eaf936
6 changed files with 4 additions and 13 deletions
+1
View File
@@ -52,6 +52,7 @@ pnpm dev:docs
> [!TIP]
>
> - Add `-e production` to the development command to check the production environment, e.g. `pnpm dev:test -e production`.
> - Add `-e debug` to enable debug mode (if applicable), e.g. `pnpm dev:test -e debug`.
> - For documentation-related theme changes, it is recommended to clone both `FixIt` and `fixit-docs` as sibling directories.
### Building
-4
View File
@@ -49,7 +49,3 @@ avatar = "https://lruihao.cn/images/avatar.jpg"
[params.mermaid]
zenuml = "https://cdn.jsdelivr.net/npm/@mermaid-js/mermaid-zenuml/dist/mermaid-zenuml.esm.min.mjs"
[params.dev]
enable = true
debug = true
-2
View File
@@ -1243,8 +1243,6 @@ postFooterAfter = []
enable = false
# Check for updates
c4u = false
# FixIt 0.4.0 | NEW Enable debug mode
debug = false
# Page config
# TODO migrate mapping key to `params` layer in the future
+1 -3
View File
@@ -3,8 +3,6 @@
@example
{{- partial "_debug/dump.html" . -}}
*/ -}}
{{- $debug := (site.Store.Get "devOpts").debug -}}
{{- if $debug | and hugo.IsServer -}}
{{- if eq hugo.Environment "debug" | and hugo.IsServer -}}
<pre>{{ debug.Dump . }}</pre>
{{- end -}}
@@ -3,9 +3,7 @@
@example
{{- partial "_debug/template-call-stack.html" . -}}
*/ -}}
{{- $debug := (site.Store.Get "devOpts").debug -}}
{{- if $debug | and hugo.IsServer -}}
{{- if eq hugo.Environment "debug" | and hugo.IsServer -}}
{{- with templates.Current -}}
<ul class="template-call-stack">
{{- range .Ancestors -}}
@@ -25,7 +25,7 @@
{{- $isRecursive := .isRecursive | default false -}}
{{- $_ignoreList := slice ".DS_Store" "Thumbs.db" ".directory" ".git" "node_modules" "public" -}}
{{- $ignoreList := .ignoreList | default slice | union $_ignoreList -}}
{{- $_debug := (site.Store.Get "devOpts").debug -}}
{{- $_debug := eq hugo.Environment "debug" | and hugo.IsServer -}}
{{- if $isRecursive -}}
{{- if le $deep $level -}}