Skip to content

pointyfar/debug-drawer-demo

Repository files navigation

What is this

hugo-debug-drawer is a Hugo Theme Component to help debug your Hugo site templates.

Debug Drawer

Where to find

Theme Component Source

Demo Source

Demo Site

How to use

Install as a theme component.

Call the debugdrawer partial from somewhere in your main theme's layouts.

Optionally, pass configuration object.

{{ $options := dict "debugdrawerpanelheight" "500px" "bugcolor" "#000000" "bugbg" "#00C09B" "hidefromdepth" 5 }}

{{ partial "debugdrawer.html" (dict "context" . "options" $options ) }}

Add layout information to your template files by including this .Scratch variable to your layout files:

{{ .Scratch.Set "debugdrawerlayout" "layouts/index.html" }}

Debug Drawer

Configuration options

debugdrawerpanelheight

  • Specify the panel's height. Default 300px.

bugcolor

  • Specify the foreground color of the bug icon. Default #FFFFFF.

bugbg

  • Specify the background color of the bug icon. Default #A62639.

hidefromdepth

  • Specify at what depth to hide the elements. Default 5.

defaultopen

  • Specify whether the panel is open by default. Default false.

Examples

See Demo Source and Demo Site.

See hidefromdepth at work here: open Page Params panel.

License

MIT