fix: case with book at site root

This commit is contained in:
Geo 2022-05-16 11:40:29 +01:00
commit 9868b04fae
3 changed files with 13 additions and 3 deletions

View file

@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [15.x]
node-version: [16.x]
steps:
- uses: actions/checkout@v2

View file

@ -90,6 +90,11 @@
}
}
.no-navbar .docs-sidebar {
top: 0;
height: 100vh;
}
@media (min-width: 1200px) {
.docs-sidebar {
flex: 0 1 320px;

View file

@ -2,9 +2,10 @@
<button class="btn docs-toggle d-md-none p-0 mr-md-3 w-100" type="button" data-toggle="collapse" data-target="#docs-nav" aria-controls="docs-nav" aria-expanded="false" aria-label="Toggle section navigation">
<div class="d-flex">
<span class="d-md-none pl-1 flex-grow-1 text-left overflow-hidden">
{{ if .Parent | and .Parent.IsHome }}
{{/* Don't use piped conditions here in order to utilise short-circuiting */}}
{{ if and .Parent .Parent.IsHome }}
{{ .LinkTitle | emojify }}
{{ else if .Parent | and (not .Parent.IsHome) }}
{{ else if and .Parent (not .Parent.IsHome) }}
{{ .Parent.LinkTitle | emojify }}
{{ else }}
{{ (i18n "home" | default "Home") | emojify }}
@ -45,6 +46,10 @@
{{- $query = .Site.Home.Sections.ByWeight -}}
{{- end}}
{{- range $query -}}
{{ template "book-menu" dict "sect" . "current_node" $current_node "order_by" $order_by "is_root" $is_root }}
{{- end -}}
{{else}}
{{/* Case where homepage is NOT a book */}}