Fix buggy match for top of documentation

The match was against the page title, which isn't as stable as the
filename of the page. Switch to matching by filename.
This commit is contained in:
Tim Bannister
2020-08-16 22:14:43 +01:00
parent c7ee5d798c
commit 63cbc7c910
+2 -2
View File
@@ -26,13 +26,13 @@
{{ $show := or (eq $s $p.FirstSection) (and (not $p.Site.Params.ui.sidebar_menu_compact) ($p.IsDescendant $s)) }}
{{ $sid := $s.RelPermalink | anchorize }}
<ul class="td-sidebar-nav__section pr-md-3">
{{ if (ne $s.File.Path "docs/_index.md") }}
<li class="td-sidebar-nav__section-title">
<a href="{{ $s.RelPermalink }}" class="align-left pl-0 pr-2{{ if not $show }} collapsed{{ end }}{{ if $active}} active{{ end }} td-sidebar-link td-sidebar-link__section">
{{ if not (eq $s.LinkTitle "Documentation") }}
{{ $s.LinkTitle }}
{{ end }}
</a>
</li>
{{ end }}
<ul>
<li class="collapse {{ if $show }}show{{ end }}" id="{{ $sid }}">
{{ $pages := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true }}