enable reading template variable from JS files

This commit is contained in:
mivinci 2021-08-23 21:40:38 +08:00
parent e7eb6932e2
commit e90b28cd24
4 changed files with 9 additions and 5 deletions

View file

@ -1,4 +1,5 @@
const light = '🌝', dark = '🌚';
const light = '{{ index .Site.Params.switch 1 }}',
dark = '{{ index .Site.Params.switch 0 }}';
const LIGHT = 'light', DARK = 'dark';
const themeSwitcher = document.getElementById('theme-switcher');