From 743ec02a6980c4ee0fbd9f2cb5f23b568dc6d706 Mon Sep 17 00:00:00 2001 From: Ngô Ngọc Đức Huy Date: Fri, 4 Aug 2023 15:19:35 +0700 Subject: Check site params only books --- layouts/_default/baseof.html | 2 +- layouts/_default/list.html | 4 ++-- layouts/partials/breadcrumbs.html | 6 +++++- layouts/partials/head.html | 2 +- layouts/partials/root-toc.html | 4 ++-- layouts/partials/toc.html | 11 +++-------- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 86a13fe..f53932d 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -9,7 +9,7 @@ SPDX-License-Identifier: MIT {{ block "head" . }} - {{ partialCached "head.html" . }} + {{ partial "head.html" . }} {{ end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 0f104a4..6dbd464 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -8,10 +8,10 @@ SPDX-License-Identifier: MIT
{{ .Content }}
- {{ if in .Params.categories "book" }} + {{ if or .Site.Params.OnlyBooks (in .Params.categories "book") }} {{ partial "post-navigation-top.html" . }}
- {{ partial "toc.html" (dict "content" . "currentLink" .RelPermalink) }} + {{ partial "toc.html" . }}
{{ else if in .Params.categories "blog" }} {{ partial "feed.html" . }} diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html index 04c4ac3..c4fcef4 100644 --- a/layouts/partials/breadcrumbs.html +++ b/layouts/partials/breadcrumbs.html @@ -1,6 +1,10 @@ +{{ $crumbs := .Ancestors.Reverse }} +{{ if not .Site.Params.OnlyBooks }} +{{ $crumbs = where $crumbs "Params.categories" "intersect" (slice "book") }} +{{ end }}