diff options
Diffstat (limited to 'src/templates/-base.html.tmpl')
-rw-r--r-- | src/templates/-base.html.tmpl | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/templates/-base.html.tmpl b/src/templates/-base.html.tmpl index 388561b..42ec216 100644 --- a/src/templates/-base.html.tmpl +++ b/src/templates/-base.html.tmpl @@ -1,32 +1,39 @@ <!DOCTYPE html> -<html lang={{ .Printer.Bcp }}> +<html lang="{{ .Printer.Bcp }}"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> + {{ if .Debugp }} + <link href="/style.css" type="text/css" rel="stylesheet"> + {{ else }} <link href="/style.min.css" type="text/css" rel="stylesheet"> - <title>{{ .Get "Euro Cash" }}</title> + {{ end }} + <title>{{ .Get "Euro Cash Wiki" }}</title> <script type="text/javascript"> const $ = q => document.querySelector(q); const $$ = q => document.querySelectorAll(q); - const validate = theme => - ["light", "dark"].includes(theme) ? theme : "light"; - const toggle = theme => - theme == "light" ? "dark" : "light"; + (() => { + const validate = theme => + ["light", "dark"].includes(theme) ? theme : "light"; + const toggle = theme => + theme == "light" ? "dark" : "light"; - const setTheme = theme => { - localStorage.setItem("theme", theme); - $("html").setAttribute("data-theme", theme); - $(`#nav-icon-theme-${theme}`).style.display = ""; - $(`#nav-icon-theme-${toggle(theme)}`).style.display = "none"; - }; + const setTheme = theme => { + localStorage.setItem("theme", theme); + $("html").setAttribute("data-theme", theme); + $(`#nav-icon-theme-${theme}`).style.display = ""; + $(`#nav-icon-theme-${toggle(theme)}`).style.display = "none"; + }; - document.addEventListener("DOMContentLoaded", _ => { - $("#theme-button").onclick = () => - setTheme(toggle(validate(localStorage.getItem("theme")))); - setTheme(validate(localStorage.getItem("theme"))); - }); + document.addEventListener("DOMContentLoaded", _ => { + $("#theme-button").onclick = () => + setTheme(toggle(validate(localStorage.getItem("theme")))); + setTheme(validate(localStorage.getItem("theme"))); + }); + })(); </script> + {{ includeIfExists "header" . }} </head> <body> {{ template "content" . }} |