From efd220cc3deb4f4c5129611fdf4e07e7515352e3 Mon Sep 17 00:00:00 2001 From: Nikolay Yakimov Date: Mon, 27 Mar 2017 23:37:46 +0300 Subject: [PATCH] Fix breadcrumbs on `/content/_index` --- layouts/partials/header.html | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index a9882a9cb7..26ce94f20c 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -51,17 +51,19 @@ {{ if and (not $isChapter) (.Params.toc) }} {{ end }} - {{ $section := index .Site.Sections .Section }} - {{ $sectionPage := $.Site.GetPage "section" $.Section }} - {{ if $sectionPage.Content }} - {{ $first := $.Site.GetPage "section" $.Section }} - {{ if ne $first.UniqueID $.UniqueID }} - - {{ end }} - {{ else if gt $section.Len 0 }} - {{ $first := (index $section 0).Page }} - {{ if ne $first.UniqueID $.UniqueID }} - + {{ if ne $.Section "" }} + {{ $section := index $.Site.Sections $.Section }} + {{ $sectionPage := $.Site.GetPage "section" $.Section }} + {{ if $sectionPage.Content }} + {{ $first := $.Site.GetPage "section" $.Section }} + {{ if ne $first.UniqueID $.UniqueID }} + + {{ end }} + {{ else if gt $section.Len 0 }} + {{ $first := (index $section 0).Page }} + {{ if ne $first.UniqueID $.UniqueID }} + + {{ end }} {{ end }} {{ end }} {{ with .Title }} {{ . }}{{ end }}