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

feat: add breadcrumb to all pages

With `show_breadcrumb: true` in front matter
George Cushen 3 лет назад
Родитель
Сommit
9e1704c71f
1 измененных файлов с 10 добавлено и 0 удалено
  1. 10 0
      wowchemy/layouts/_default/baseof.html

+ 10 - 0
wowchemy/layouts/_default/baseof.html

@@ -35,6 +35,16 @@
   </div>
 
   <div class="page-body">
+    {{/* Breadcrumb */}}
+    {{/* Don't apply to Book layout as that has different breadcrumb placement. */}}
+    {{ if .Params.show_breadcrumb | and (ne .Type "book") }}
+      <!-- Use page bg color rather than any color applied to article-container. -->
+      {{ $class := cond .IsSection "universal-wrapper" "article-container" }}
+      <div class="{{$class}} py-1" style="background: initial">
+        {{ partial "components/breadcrumb" . }}
+      </div>
+    {{ end }}
+
     {{ block "main" . }}{{ end }}
   </div>