feat(devtools): add template call stack for debugging

This commit is contained in:
Cell
2026-01-09 12:29:43 +08:00
parent 8b5315a141
commit 50d27e0e5b
3 changed files with 19 additions and 1 deletions
+2
View File
@@ -1187,6 +1187,8 @@ 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
@@ -0,0 +1,16 @@
{{- /*
Render template call stack for debugging purpose.
Call the partial from any template: {{- partial "devtools/template-call-stack.html" . -}}
*/ -}}
{{- if .Site.Params.dev.debug | and hugo.IsServer -}}
{{- with templates.Current -}}
<ul class="template-call-stack">
{{- range .Ancestors -}}
<li><a href="vscode://file/{{ .Filename }}"><small>{{ .Filename }}</small></a></li>
{{- with .Base -}}
<li><a href="vscode://file/{{ .Filename }}"><small>{{ .Filename }}</small></a></li>
{{- end -}}
{{- end -}}
</ul>
{{- end -}}
{{- end -}}
+1 -1
View File
@@ -1,4 +1,4 @@
{{- hugo.Store.Set "version" "v0.4.2-20260108093145-c257b9b1" -}}
{{- hugo.Store.Set "version" "v0.4.2-20260109042944-8b5315a1" -}}
{{- .Store.Set "this" dict -}}
{{- partial "init/detection-env.html" . -}}