diff --git a/layouts/shortcodes/toc-tree.html b/layouts/shortcodes/toc-tree.html
new file mode 100644
index 0000000..7fe4620
--- /dev/null
+++ b/layouts/shortcodes/toc-tree.html
@@ -0,0 +1,35 @@
+{{ $tocLevels := default (default 6 .Site.Params.GeekdocToC) .Page.Params.GeekdocToC }}
+
+{{ if $tocLevels }}
+
+ {{ template "toc-tree" dict "sect" .Page.Pages }}
+
+{{ end }}
+
+
+{{ define "toc-tree" }}
+
+ {{ range .sect.GroupBy "Weight" }}
+ {{ range .ByTitle }}
+ {{ if not .Params.geekdocHidden }}
+ -
+ {{ if or .Content .Params.geekdocFlatSection }}
+
+
+ {{ partial "title" . }}
+
+
+ {{ else }}
+ {{ partial "title" . }}
+ {{ end }}
+
+ {{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
+ {{ if and (ne $numberOfPages 0) (not .Params.geekdocFlatSection) }}
+ {{ template "toc-tree" dict "sect" .Pages }}
+ {{ end }}
+
+ {{ end }}
+ {{ end }}
+ {{ end }}
+
+{{ end }}