mirror of https://github.com/docker/docs.git
search: refactor page entries in toc
Wraps the entry title in a span element so that we can have a single querySelector to get the textContent of the title of a top-level toc item of a page: document.querySelector("#sectiontree li:has([aria-current]) :is(a, button) span") Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
fd264a9df3
commit
3ac25b7a2c
|
@ -53,10 +53,10 @@
|
|||
{{ $isCurrent := eq (urls.Parse $ctx.Permalink).Path .entry.path }}
|
||||
<li class="pl-4 sidebar-hover rounded
|
||||
{{ if $isCurrent }} bg-gray-light-200 dark:bg-gray-dark-200{{ end }}">
|
||||
<span class="flex items-center">
|
||||
<a {{ if $isCurrent }}aria-current="page" {{ end }} class="py-2 w-full truncate"
|
||||
href="{{ .entry.path }}" title="{{ markdownify .entry.title }}">{{ markdownify .entry.title }}</a>
|
||||
</span>
|
||||
<a {{ if $isCurrent }}aria-current="page" {{ end }} class="py-2 w-full truncate block"
|
||||
href="{{ .entry.path }}" title="{{ markdownify .entry.title }}"
|
||||
><span>{{ markdownify .entry.title }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in New Issue