Просмотр исходного кода

Fix empty leaf pages after hugo update

master
Chris Smith 4 лет назад
Родитель
Сommit
dc7f2476f5
Подписано: Chris Smith <chris@chameth.com> Идентификатор GPG ключа: 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 }}

Загрузка…
Отмена
Сохранить