diff --git a/layouts/partials/components/sidebar/item-link.html b/layouts/partials/components/sidebar/item-link.html
index ea7396e..6fd4345 100644
--- a/layouts/partials/components/sidebar/item-link.html
+++ b/layouts/partials/components/sidebar/item-link.html
@@ -15,4 +15,5 @@
{{- partialCached "components/sidebar/collapsible-button" . }}
{{- end }}
{{ end -}}
+ {{- with .items }}{{- partialCached "components/sidebar/collapsible-button" site.Home }}{{ end -}}
diff --git a/layouts/partials/components/sidebar/render-data.html b/layouts/partials/components/sidebar/render-data.html
new file mode 100644
index 0000000..bbbb196
--- /dev/null
+++ b/layouts/partials/components/sidebar/render-data.html
@@ -0,0 +1,15 @@
+{{- $page := .page -}}
+{{- $pageLink := $page.RelPermalink -}}
+
+{{- range .data -}}
+ {{- $active := or (eq $pageLink .link) (eq (strings.TrimSuffix "/" $pageLink) .link) -}}
+ {{- $containsPage := hasPrefix $pageLink .link -}}
+ {{- $shouldOpen := or (.open) $containsPage $active | default true -}}
+
+
+ {{- partial "components/sidebar/item-link" (dict "active" $active "title" .title "link" .link "items" .items) -}}
+ {{- if .items -}}
+ {{- partial "components/sidebar/render-items" (dict "items" .items "link" $pageLink) -}}
+ {{- end -}}
+
+{{ end }}
diff --git a/layouts/partials/components/sidebar/render-items.html b/layouts/partials/components/sidebar/render-items.html
new file mode 100644
index 0000000..d177185
--- /dev/null
+++ b/layouts/partials/components/sidebar/render-items.html
@@ -0,0 +1,20 @@
+{{- $items := .items -}}
+{{- $pageLink := .link -}}
+{{ $shouldOpen := true }}
+
+
+
+
+ {{- range $items }}
+ {{- $active := or (eq $pageLink .link) (eq (strings.TrimSuffix "/" $pageLink) .link) -}}
+ -
+ {{- partial "components/sidebar/item-link" (dict "active" $active "title" .title "link" .link "items" .items) -}}
+ {{- if .items -}}
+ {{- partial "components/sidebar/render-items" (dict "items" .items "link" .link) -}}
+ {{- end -}}
+
+ {{- end -}}
+
+
diff --git a/layouts/partials/sidebar-ng.html b/layouts/partials/sidebar-ng.html
index 8eeed1a..e9d8689 100644
--- a/layouts/partials/sidebar-ng.html
+++ b/layouts/partials/sidebar-ng.html
@@ -25,7 +25,7 @@
{{ with $data }}
{{ warnf "The data file for the sidebar is still unstable. Please use caution when upgrading." }}
-
{{ . | jsonify (dict "indent" " ") }}
+ {{ partial "components/sidebar/render-data" (dict "data" . "page" $context) }}
{{ end }}
{{ partialCached "components/sidebar/footer" $context site.Home }}