|
3 | 3 | {{ $firstSection := .firstSection }} |
4 | 4 | {{ $idPrefix := .idPrefix }} |
5 | 5 | {{ with $firstSection }} |
6 | | -<ul class="sidebar__ul"> |
| 6 | +<ul class="sidebar__ul" data-testid="sidebar__ul"> |
7 | 7 | {{ $pages := .Pages.ByWeight }} |
8 | 8 | {{ range $index, $p := $pages }} |
9 | 9 | {{- $onPage := eq $currentUrl $p.Permalink -}} |
|
14 | 14 | {{- $nextIndex := add $index 1 -}} |
15 | 15 | {{- $nextLink := index $pages $nextIndex -}} |
16 | 16 | {{ if eq $p.Kind "section" }} |
17 | | - <li class="sidebar__section"> |
| 17 | + <li class="sidebar__section" data-testid="sidebar__section"> |
18 | 18 | <button |
19 | 19 | id="{{ $linkID }}" |
20 | 20 | class="sidebar__toggle {{ if $isAncestor }}sidebar__toggle--ancestor{{ end }}" |
| 21 | + data-testid="sidebar__section__toggle" |
21 | 22 | aria-expanded="{{ $shouldExpand }}" |
22 | 23 | aria-controls="{{ $sectionID }}" |
23 | 24 | > |
|
33 | 34 | > |
34 | 35 | {{ if and .Content (gt (len .Pages) 0) }} |
35 | 36 | <ul> |
36 | | - <li class="sidebar__page"> |
| 37 | + <li class="sidebar__page" data-testid="sidebar__page"> |
37 | 38 | <a |
38 | 39 | href="{{ $p.Permalink }}" |
39 | 40 | class="sidebar__link {{ if $onPage }}sidebar__link--current{{ end }}" |
|
57 | 58 | {{- $tocHasItems := (in $p.TableOfContents "<li>") -}} |
58 | 59 | {{- $pageHasTOC := (and $onPage $tocHasItems $p.Params.toc) -}} |
59 | 60 | {{- $tocID := printf "%stoc-%s" $idPrefix (urlize $p.Permalink) -}} |
60 | | - <li class="sidebar__page"> |
| 61 | + <li class="sidebar__page" data-testid="sidebar__page"> |
61 | 62 | {{ if $pageHasTOC }} |
62 | 63 | <button |
63 | 64 | class="sidebar__toggle sidebar__link sidebar__link--current" |
|
0 commit comments