From 6302a4b82ba219fc1b7597a6165ae4d88aa8b2ac Mon Sep 17 00:00:00 2001
From: Joseph Sanders <jls83@users.noreply.github.com>
Date: Tue, 29 Sep 2020 21:32:00 +0000
Subject: [PATCH] Add Option To Hide Color Scheme Toggle (#406)
---
exampleSite/config.toml | 3 +++
layouts/partials/header.html | 16 ++++++++++------
stackbit.yaml | 2 ++
CONTRIBUTORS.md | 1 +
4 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index ca02f49..2c58b53 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -77,3 +77,4 @@
- [Jared Sturdy](https://github.com/jsturdy)
- [Daniel Monteiro](https://github.com/dfamonteiro)
- [Dave Rolsky](https://github.com/autarch)
+- [Joseph Sanders](https://github.com/jls83)
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 7089630..0869cd6 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -42,6 +42,9 @@
# "light" (light background, dark foreground) (default)
colorscheme = "auto"
+ # Hide the toggle button, along with the associated vertical divider
+ hidecolorschemetoggle = false
+
# Series see also post count
maxSeeAlsoItems = 5
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 2bac40c..c4b5cb5 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -4,9 +4,11 @@
{{ .Site.Title }}
</a>
{{ if or .Site.Menus.main .Site.IsMultiLingual }}
- <span id="dark-mode-toggle" class="float-right">
- <i class="fa fa-adjust fa-fw" aria-hidden="true"></i>
- </span>
+ {{ if not .Site.Params.hidecolorschemetoggle }}
+ <span id="dark-mode-toggle" class="float-right">
+ <i class="fa fa-adjust fa-fw" aria-hidden="true"></i>
+ </span>
+ {{ end }}
<input type="checkbox" id="menu-toggle" />
<label class="menu-button float-right" for="menu-toggle">
<i class="fa fa-bars fa-fw" aria-hidden="true"></i>
@@ -36,9 +38,11 @@
{{ end }}
{{ end }}
{{ end }}
- <li class="navigation-item separator">
- <span>|</span>
- </li>
+ {{ if not .Site.Params.hidecolorschemetoggle }}
+ <li class="navigation-item separator">
+ <span>|</span>
+ </li>
+ {{ end }}
</ul>
{{ end }}
</section>
diff --git a/stackbit.yaml b/stackbit.yaml
index 1050376..a6f3dc2 100644
--- a/stackbit.yaml
+++ b/stackbit.yaml
@@ -66,6 +66,8 @@
name: hideCredits
- type: boolean
name: hideCopyright
+ - type: boolean
+ name: hidecolorschemetoggle
- type: number
name: since
- type: string
--
Gitblit v1.10.0