Browse Source

config option to show theme switcher

zwbetz-gh 4 years ago
parent
commit
1a3ed20f93
3 changed files with 9 additions and 1 deletions
  1. 1 0
      exampleSite/config.yaml
  2. 3 1
      layouts/partials/footer.html
  3. 5 0
      task_serve.sh

+ 1 - 0
exampleSite/config.yaml

@@ -26,6 +26,7 @@ params:
   katex: true
   hideHeaderLinks: false
   search: true
+  showThemeSwitcher: true
   customCss:
     - css/custom_01.css
     - css/custom_02.css

+ 3 - 1
layouts/partials/footer.html

@@ -1,5 +1,7 @@
 <footer role="contentinfo">
-  <div>
+  <div
+  {{ if eq .Site.Params.showThemeSwitcher false }}style="display: none;"{{ end }}
+  >
     <label for="themer">
       {{ T "dark_theme" }} <input type="checkbox" id="themer" class="vh">
       <!-- Shows "on" or "off" -->

+ 5 - 0
task_serve.sh

@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+cd exampleSite
+hugo serve --themesDir ../..
+cd ..