@@ -190,10 +170,34 @@ {{ end }} {{ define "toc" }} + +{{ end }} + +{{ define "toc-children" }} {{ range .Documents.Children .Slug }}
  • {{.Title}}
  • {{ if expand .Slug $.Active }} - {{ template "toc" (params "Active" $.Active "Documents" $.Documents "Index" (inc $.Index) "Slug" .Slug) }} + {{ template "toc-children" (params "Active" $.Active "Documents" $.Documents "Index" (inc $.Index) "Slug" .Slug) }} {{ end }} {{ end }} {{ end }} \ No newline at end of file diff --git a/cmd/docs/templates/toc.tmpl b/cmd/docs/templates/toc.tmpl new file mode 100644 index 0000000..549a608 --- /dev/null +++ b/cmd/docs/templates/toc.tmpl @@ -0,0 +1,3 @@ +{{ define "main" }} + {{ template "toc" . }} +{{ end }}