From 50d27e0e5bdc503a42d58a76582534b547fa984e Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Fri, 9 Jan 2026 12:29:43 +0800 Subject: [PATCH] feat(devtools): add template call stack for debugging --- hugo.toml | 2 ++ .../_partials/devtools/template-call-stack.html | 16 ++++++++++++++++ layouts/_partials/init/index.html | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 layouts/_partials/devtools/template-call-stack.html diff --git a/hugo.toml b/hugo.toml index 55122a38..21c5c182 100644 --- a/hugo.toml +++ b/hugo.toml @@ -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 diff --git a/layouts/_partials/devtools/template-call-stack.html b/layouts/_partials/devtools/template-call-stack.html new file mode 100644 index 00000000..6976fe0c --- /dev/null +++ b/layouts/_partials/devtools/template-call-stack.html @@ -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 -}} +