Home

blog @615129be36f02b57ea0065ba9af6196f34014938 - refs - log -
-
https://git.jolheiser.com/blog.git
My nonexistent blog
blog / _example / templates / base.tmpl
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{{define "head"}}
<!DOCTYPE html>
<head>
<title>{{.}}</title>
<link id="style" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css"/>
<link rel="stylesheet" href="chroma.css"/>

<script>
  (() => {
    const params = new URLSearchParams(window.location.search);
    const style = params.get('style');
    const $style = document.querySelector('#style');
    let href = "https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css";
    if (style === null) href = localStorage.getItem("style") ?? href;
    if (style === "pico") href = "https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.classless.min.css";
    if (style === "simple") href = "simple.css";
    if (style === "sakura") href = "sakura.css";
    $style.href = href;
    localStorage.setItem("style", href)
  })()
</script>
</head>
{{end}}