소스 검색

Fix empty leaf pages after hugo update

master
Chris Smith 4 년 전
부모
커밋
dc7f2476f5
로그인 계정: Chris Smith <chris@chameth.com> GPG Key ID: 3A2D4BBDC4A3C9A9
1개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  1. 7
    5
      themes/book/layouts/partials/docs/menu-filetree.html

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

Loading…
취소
저장