internal/godoc: collapse top level headings in doc outline
Updates template so that the initial render of the sidenav
has no items expanded.
Trust: Jamal Carvalho
@@ -24,7 +24,7 @@ const tmplSidenav = `
<a href="#pkg-variables" role="treeitem" aria-level="1" tabindex="-1">Variables</a>
</li>
<li class="DocNav-functions" role="none">
- <span class="DocNav-groupLabel" role="treeitem" aria-expanded="true" aria-level="1" aria-owns="nav-group-functions" tabindex="-1">Functions</span>
+ <span class="DocNav-groupLabel" role="treeitem" aria-expanded="false" aria-level="1" aria-owns="nav-group-functions" tabindex="-1">Functions</span>
<ul role="group" id="nav-group-functions">
{{range .Funcs}}
<li role="none">
@@ -34,7 +34,7 @@ const tmplSidenav = `
</ul>
</li>
<li class="DocNav-types" role="none">
- <span class="DocNav-groupLabel" role="treeitem" aria-expanded="true" aria-level="1" aria-owns="nav-group-types" tabindex="-1">Types</span>
+ <span class="DocNav-groupLabel" role="treeitem" aria-expanded="false" aria-level="1" aria-owns="nav-group-types" tabindex="-1">Types</span>
<ul role="group" id="nav-group-types">
{{range .Types}}
{{$tname := .Name}}
@@ -42,7 +42,7 @@ const tmplSidenav = `
{{if or .Funcs .Methods}}
{{$navgroupname := (printf "nav.group.%s" $tname)}}
{{$navgroupid := (safe_id $navgroupname)}}
- <a class="DocNav-groupLabel" href="#{{$tname}}" role="treeitem" aria-expanded="true" aria-level="2" data-aria-owns="{{$navgroupid}}" tabindex="-1">type {{$tname}}</a>
+ <a class="DocNav-groupLabel" href="#{{$tname}}" role="treeitem" aria-expanded="false" aria-level="2" data-aria-owns="{{$navgroupid}}" tabindex="-1">type {{$tname}}</a>
<ul role="group" id="{{$navgroupid}}">
{{range .Funcs}}
<li role="none">
@@ -63,7 +63,7 @@ const tmplSidenav = `
</ul>
</li>
<li class="DocNav-notes" role="none">
- <span class="DocNav-groupLabel" role="treeitem" aria-expanded="true" aria-level="1" aria-owns="nav-group-notes" tabindex="-1">Notes</span>
+ <span class="DocNav-groupLabel" role="treeitem" aria-expanded="false" aria-level="1" aria-owns="nav-group-notes" tabindex="-1">Notes</span>
<ul role="group" id="nav-group-notes">
{{range $marker, $item := .Notes}}
<li role="none">
