Skip to content

Commit b031c66

Browse files
committed
update book menu
1 parent 56b25b1 commit b031c66

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

assets/scss/bookmenu.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,22 +98,22 @@ aside .book-nav ul {
9898
}
9999

100100
input.toggle + label::after {
101-
content: ">";
101+
content: "";
102102
}
103103

104104
input.toggle:checked + label::after {
105-
content: "^";
105+
content: "";
106106
}
107107
}
108108

109109
// for RTL support
110110
body[dir="rtl"] .book-menu {
111111
input.toggle + label::after {
112-
content: "<";
112+
content: "";
113113
}
114114

115115
input.toggle:checked + label::after {
116-
content: "^";
116+
content: "";
117117
}
118118
}
119119

layouts/partials/book-menu-filetree.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
{{ $bookSection = "/" }}{{/* Backward compatibility */}}
44
{{ end }}
55

6-
{{ with .Site.GetPage $bookSection .CurrentSection.Title }}
6+
{{ $dirs := (split .CurrentSection.File.Dir "/") }}
7+
{{ $dir := "" }}
8+
{{ if and (gt (len $dirs) 1) (ne (index $dirs 0) "posts") }}
9+
{{ $dir = (index $dirs 0) }}
10+
{{ else if and (gt (len $dirs) 2) (eq (index $dirs 0) "posts" ) }}
11+
{{ $dir = (index $dirs 1) }}
12+
{{ end }}
13+
{{ with .Site.GetPage $bookSection $dir }}
714
{{ template "book-section-children" (dict "Section" . "CurrentPage" $) }}
815
{{ end }}
916

0 commit comments

Comments
 (0)