add styling for details docs-menu

This commit is contained in:
a 2022-12-11 18:55:00 -06:00
parent 73d11f00b8
commit 22e851dbe9
2 changed files with 5 additions and 3 deletions

View file

@ -21,7 +21,7 @@
padding: 1em 0; padding: 1em 0;
.menu { .menu {
margin-top: 1em; margin-top: 1em;
> li { > li, > details {
margin-bottom: 1em; margin-bottom: 1em;
> a { > a {
display: block; display: block;

View file

@ -10,10 +10,12 @@
{{ $currentPage := . }} {{ $currentPage := . }}
{{ range .Site.Menus.docs }} {{ range .Site.Menus.docs }}
{{ $active := or ($currentPage.IsMenuCurrent "docs" .) (eq $currentPage.Section .Identifier)}} {{ $active := or ($currentPage.IsMenuCurrent "docs" .) (eq $currentPage.Section .Identifier)}}
<details class='section-title{{- if $active }} active{{ end -}}' {{- if $active }} open{{ end -}}> <details {{- if $active }} open{{ end -}}>
{{ if .HasChildren }} {{ if .HasChildren }}
<summary href="{{ .URL | relLangURL }}"> <summary class='section-title{{- if $active }} active{{ end -}}'>
<a>
{{ .Pre }}<span>{{ .Name }}</span>{{ .Post }} {{ .Pre }}<span>{{ .Name }}</span>{{ .Post }}
</a>
</summary> </summary>
<ul class="sub-menu" data-depth=1> <ul class="sub-menu" data-depth=1>
{{ range .Children }} {{ range .Children }}