diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html
index 3a409321649..8e89b55ab74 100644
--- a/layouts/partials/menu.html
+++ b/layouts/partials/menu.html
@@ -97,18 +97,25 @@
{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}
{{with .sect}}
{{if .IsSection}}
{{safeHTML .Params.head}}
+ {{ $isParent := or (.IsAncestor $currentNode) (.Params.alwaysopen) }}
+ {{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
{{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}}
+ {{ if and (ne $numberOfPages 0) (ne .Parent .Site.Home) }}
+ {{if $isParent }}
+
+ {{ else }}
+
+ {{ end }}
+ {{ end }}
{{ if $showvisitedlinks}}
{{ end }}
- {{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
{{ if ne $numberOfPages 0 }}
{{ $currentNode.Scratch.Set "pages" .Pages }}
diff --git a/static/css/theme.css b/static/css/theme.css
index 0c0818775d8..407fbeb8ae0 100644
--- a/static/css/theme.css
+++ b/static/css/theme.css
@@ -257,7 +257,7 @@ textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[typ
#sidebar ul.topics ul ul {
padding-bottom: 0;
}
-#sidebar ul.topics li.parent ul, #sidebar ul.topics > li.active ul {
+#sidebar ul.topics li.parent > ul {
display: block;
}
#sidebar ul.topics > li > a {