Browse Source

Fix empty leaf pages after hugo update

master
Chris Smith 4 years ago
parent
commit
dc7f2476f5
Signed by: Chris Smith <chris@chameth.com> GPG Key ID: 3A2D4BBDC4A3C9A9
1 changed files with 7 additions and 5 deletions
  1. 7
    5
      themes/book/layouts/partials/docs/menu-filetree.html

+ 7
- 5
themes/book/layouts/partials/docs/menu-filetree.html View File

@@ -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 }}

Loading…
Cancel
Save