diff --git a/assets/scss/academic/_docs.scss b/assets/scss/academic/_docs.scss index c6ebdc85..7f20e068 100644 --- a/assets/scss/academic/_docs.scss +++ b/assets/scss/academic/_docs.scss @@ -108,6 +108,7 @@ } .docs-sidebar .docs-toc-item.active a, +.docs-sidebar .docs-toc-item a.active, // Book layout sidebar links .docs-sidebar .nav>.active:hover>a, .docs-sidebar .nav>.active>a { font-weight: bold; diff --git a/layouts/index.html b/layouts/index.html index 40d4d8f3..ad964adf 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -15,6 +15,10 @@ {{ end }} {{/* Generate homepage. */}} -{{ partial "widget_page.html" . }} +{{ if eq .Type "book" }} + {{ partial "book_layout.html" . }} +{{ else }} + {{ partial "widget_page.html" . }} +{{ end }} {{- end -}} diff --git a/layouts/partials/book_menu.html b/layouts/partials/book_menu.html index 0d58f8f5..3a0cd934 100644 --- a/layouts/partials/book_menu.html +++ b/layouts/partials/book_menu.html @@ -2,12 +2,15 @@ {{- $first := false -}} {{- $current_node := .current_node -}} +{{- $is_root := .is_root -}} {{- $order_by := .order_by -}} {{ $icon := "" }} {{ with .sect }} {{ if .IsSection}} - {{- $first = eq $current_node.FirstSection . -}} + {{ if not $is_root }} + {{- $first = eq $current_node.FirstSection . -}} + {{ end }} {{- safeHTML $current_node.FirstSection.Params.pre_nav -}} diff --git a/layouts/partials/book_sidebar.html b/layouts/partials/book_sidebar.html index 6e33b406..968c5d68 100644 --- a/layouts/partials/book_sidebar.html +++ b/layouts/partials/book_sidebar.html @@ -10,19 +10,35 @@