diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ccd87657..da7bed2f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/apps/test/hugo.toml b/apps/test/hugo.toml index 5445dbcd..7c0bf6a6 100644 --- a/apps/test/hugo.toml +++ b/apps/test/hugo.toml @@ -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 diff --git a/hugo.toml b/hugo.toml index 65d36218..4100ae3c 100644 --- a/hugo.toml +++ b/hugo.toml @@ -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 diff --git a/layouts/_partials/_debug/dump.html b/layouts/_partials/_debug/dump.html index 6f6de489..627ce713 100644 --- a/layouts/_partials/_debug/dump.html +++ b/layouts/_partials/_debug/dump.html @@ -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 -}}
{{ debug.Dump . }}
{{- end -}}
diff --git a/layouts/_partials/_debug/template-call-stack.html b/layouts/_partials/_debug/template-call-stack.html
index 0f91b13f..6850571c 100644
--- a/layouts/_partials/_debug/template-call-stack.html
+++ b/layouts/_partials/_debug/template-call-stack.html
@@ -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 -}}