Переглянути джерело

Fix empty leaf pages after hugo update

master
Chris Smith 4 роки тому
джерело
коміт
dc7f2476f5
Підписано: Chris Smith <chris@chameth.com> Ідентифікатор GPG ключа: 3A2D4BBDC4A3C9A9

+ 7
- 5
themes/book/layouts/partials/docs/menu-filetree.html Переглянути файл

@@ -1,5 +1,5 @@
1 1
 <!-- Put configured sections list to .Scratch -->
2
-{{ template "book-get-root-section" . }} 
2
+{{ template "book-get-root-section" . }}
3 3
 
4 4
 {{- range .Scratch.Get "BookSections" -}}
5 5
   {{ template "book-section" (dict "Section" . "CurrentPage" $.Permalink) }}
@@ -20,9 +20,11 @@
20 20
     {{ end }}
21 21
 
22 22
     {{ range .Section.Pages }}
23
-    <li>
24
-      {{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
25
-    </li>
23
+      {{- if .Content -}}
24
+        <li>
25
+          {{ template "book-page-link" (dict "Page" . "CurrentPage" $.CurrentPage) }}
26
+        </li>
27
+     {{- end -}}
26 28
     {{ end }}
27 29
   </ul>
28 30
 {{ end }}
@@ -44,4 +46,4 @@
44 46
     {{ $bookSections := where .Site.Sections "Section" $bookSection }}
45 47
     {{ .Scratch.Set "BookSections" $bookSections }}
46 48
   {{ end }}
47
-{{ end }}
49
+{{ end }}

Завантаження…
Відмінити
Зберегти