- {{ partial "sidebar.html" (dict "context" . "disableSidebar" true) }}
+ {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }}
{{ .Title }}
diff --git a/layouts/blog/single.html b/layouts/blog/single.html index ff2dbcc..1912987 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -1,6 +1,6 @@ {{ define "main" }}
- {{ partial "sidebar.html" (dict "context" . "disableSidebar" true) }}
+ {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }}
{{ partial "toc.html" . }}
diff --git a/layouts/index.html b/layouts/index.html
index b6651f2..8b183e0 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,6 +1,6 @@
{{ define "main" }}
- {{ partial "sidebar.html" (dict "context" . "disableSidebar" true) }}
+ {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }}
{{ partial "toc.html" . }}
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index 5e252fb..a008cbf 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -1,6 +1,9 @@
{{- $context := .context -}}
+
{{- $disableSidebar := .disableSidebar | default false -}}
-{{- $sidebarClass := cond $disableSidebar "md:hidden xl:block" "md:sticky" -}}
+{{- $displayPlaceholder := .displayPlaceholder | default false -}}
+
+{{- $sidebarClass := cond $disableSidebar (cond $displayPlaceholder "md:hidden xl:block" "md:hidden") "md:sticky" -}}
{{- $navRoot := cond (eq site.Home.Type "docs") site.Home $context.FirstSection -}}
{{- $navPages := union $navRoot.RegularPages $navRoot.Sections -}}
@@ -20,8 +23,8 @@
- {{- if $disableSidebar }}
-
+ {{- if $disableSidebar -}}
+ {{- if $displayPlaceholder }}{{ end -}}
{{ .context.Scratch.Set "enableFooterSwitches" true }}
{{- else -}}