diff --git a/layouts/partials/body.print.html b/layouts/partials/body.print.html
index e7c28fafab..2bb4228d0b 100644
--- a/layouts/partials/body.print.html
+++ b/layouts/partials/body.print.html
@@ -4,7 +4,7 @@
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
{{- $currentOrdersectionsby := .Site.Home.Params.ordersectionsby | default $defaultOrdersectionsby }}
{{- if $isActive }}
- {{- template "section-print" dict "sect" . "currentnode" $currentNode }}
+ {{- template "section-print" dict "sect" . "currentnode" $currentNode }}
{{- if or .IsHome .Params.chapter $pages }}
{{- end }}
@@ -43,7 +43,7 @@
{{- $defaultOrdersectionsby := .Site.Params.ordersectionsby | default "weight" }}
{{- $currentOrdersectionsby := .Params.ordersectionsby | default $defaultOrdersectionsby }}
{{- if $isActive }}
- {{- template "section-print" dict "sect" . "currentnode" $currentNode }}
+ {{- template "section-print" dict "sect" . "currentnode" $currentNode }}
{{- if or .IsHome .Params.chapter $pages }}
{{- end }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 612cc8da45..68c5080a95 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -8,7 +8,7 @@
{{- $wantsMermaid := or (and (eq (.Scratch.Get "relearnOutputFormat") "HTML") (.Page.Store.Get "htmlHasMermaid")) (and (eq (.Scratch.Get "relearnOutputFormat") "PRINT") (.Page.Store.Get "printHasMermaid")) }}
-{{- if (or $wantsMermaid (and (ne .Params.disableMermaid nil) (not .Params.disableMermaid)) (and (ne .Site.Params.disableMermaid nil) (not .Site.Params.disableMermaid)) ) }}
+{{- if $wantsMermaid }}
{{- if isset .Params "custommermaidurl" }}
@@ -38,7 +38,7 @@
{{- end }}
{{- $wantsSwagger := or (and (eq (.Scratch.Get "relearnOutputFormat") "HTML") (.Page.Store.Get "htmlHasSwagger")) (and (eq (.Scratch.Get "relearnOutputFormat") "PRINT") (.Page.Store.Get "printHasSwagger")) }}
-{{- if (or $wantsSwagger (and (ne .Params.disableSwagger nil) (not .Params.disableSwagger)) (and (ne .Site.Params.disableSwagger nil) (not .Site.Params.disableSwagger)) ) }}
+{{- if $wantsSwagger }}
{{- if isset .Params "customswaggerurl" }}
{{- else if isset .Site.Params "customswaggerurl" }}
diff --git a/layouts/partials/page-meta.hugo b/layouts/partials/page-meta.hugo
index 8e30da4efc..d6a32196f7 100644
--- a/layouts/partials/page-meta.hugo
+++ b/layouts/partials/page-meta.hugo
@@ -6,6 +6,14 @@
{{- $currentNode.Scratch.Delete "relearnIsHiddenNode" }}{{/* the node itself is flagged as hidden */}}
{{- $currentNode.Scratch.Delete "relearnIsHiddenStem" }}{{/* the node or one of its parents is flagged as hidden */}}
{{- $currentNode.Scratch.Delete "relearnIsHiddenFrom" }}{{/* the node is hidden from the current page */}}
+{{- $wantsMermaid := or (and (ne $currentNode.Params.disableMermaid nil) (not $currentNode.Params.disableMermaid)) (and (ne .Site.Params.disableMermaid nil) (not .Site.Params.disableMermaid)) }}
+{{- if $wantsMermaid }}
+ {{- $currentNode.Page.Store.Set "htmlHasMermaid" true }}
+{{- end }}
+{{- $wantsSwagger := or (and (ne .Params.disableSwagger nil) (not .Params.disableSwagger)) (and (ne .Site.Params.disableSwagger nil) (not .Site.Params.disableSwagger)) }}
+{{- if $wantsSwagger }}
+ {{- $currentNode.Page.Store.Set "htmlHasSwagger" true }}
+{{- end }}
{{- template "relearn-structure" dict "node" .Site.Home "currentnode" $currentNode "hiddenstem" false "hiddencurrent" false "defaultOrdersectionsby" .Site.Params.ordersectionsby }}
{{- define "relearn-structure" }}
{{- $currentNode := .currentnode }}