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
 <!-- Put configured sections list to .Scratch -->
1
 <!-- Put configured sections list to .Scratch -->
2
-{{ template "book-get-root-section" . }} 
2
+{{ template "book-get-root-section" . }}
3
 
3
 
4
 {{- range .Scratch.Get "BookSections" -}}
4
 {{- range .Scratch.Get "BookSections" -}}
5
   {{ template "book-section" (dict "Section" . "CurrentPage" $.Permalink) }}
5
   {{ template "book-section" (dict "Section" . "CurrentPage" $.Permalink) }}
20
     {{ end }}
20
     {{ end }}
21
 
21
 
22
     {{ range .Section.Pages }}
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
     {{ end }}
28
     {{ end }}
27
   </ul>
29
   </ul>
28
 {{ end }}
30
 {{ end }}
44
     {{ $bookSections := where .Site.Sections "Section" $bookSection }}
46
     {{ $bookSections := where .Site.Sections "Section" $bookSection }}
45
     {{ .Scratch.Set "BookSections" $bookSections }}
47
     {{ .Scratch.Set "BookSections" $bookSections }}
46
   {{ end }}
48
   {{ end }}
47
-{{ end }}
49
+{{ end }}

Loading…
Cancel
Save