mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02:00
fix: case with book at site root
This commit is contained in:
parent
c83227df43
commit
9868b04fae
3 changed files with 13 additions and 3 deletions
2
.github/workflows/build-test-site.yaml
vendored
2
.github/workflows/build-test-site.yaml
vendored
|
@ -15,7 +15,7 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node-version: [15.x]
|
||||
node-version: [16.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
|
|
@ -90,6 +90,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
.no-navbar .docs-sidebar {
|
||||
top: 0;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.docs-sidebar {
|
||||
flex: 0 1 320px;
|
||||
|
|
|
@ -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 */}}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue