Skip to content

Commit 341a045

Browse files
committed
add dark mode
1 parent 3257cac commit 341a045

File tree

4 files changed

+109
-1
lines changed

4 files changed

+109
-1
lines changed

config.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ menu:
3434
url: "https://github.com/kausalflow/tools/discussions"
3535

3636
params:
37-
theme_variant: "journal" # possible value for the theme_variant `cerulean,cosmo,cyborg,darkly,flatly,journal,litera,lumen,lux,materia,minty,pulse,sandstone,simplex,slate,solar,spacelab,superhero,united,yeti`
37+
theme_variant:
38+
light: "journal" # possible value for the theme_variant `cerulean,cosmo,cyborg,darkly,flatly,journal,litera,lumen,lux,materia,minty,pulse,sandstone,simplex,slate,solar,spacelab,superhero,united,yeti`
39+
dark: "darkly"
3840
description: "A Curated List of Research Tool"
3941
logo: "/assets/logo/kausalflow_bare.png"
4042
favicon: "/assets/logo/kausalflow_bare.png"
@@ -103,3 +105,8 @@ taxonomies:
103105
category: "categories"
104106
tag: "tags"
105107
collection: "collections"
108+
109+
110+
security:
111+
gotemplates:
112+
allowActionJSTmpl: true

layouts/_default/baseof.html

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<!DOCTYPE html>
2+
<html lang="{{ .Site.LanguageCode }}">
3+
4+
<head>
5+
{{ hugo.Generator }}
6+
<meta charset="utf-8">
7+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<title>{{ block "title" . }}{{ .Title }}{{ end }} | {{ .Site.Title }} | {{ .Site.Params.author }} </title>
10+
11+
{{ with .Description }}
12+
<meta name="description" content="{{ . }}"> {{ end }}
13+
{{ $default_noindex_kinds := slice "section" "taxonomy" "taxonomyTerm" }}
14+
{{ $noindex_kinds := .Site.Params.noindex_kinds | default $default_noindex_kinds }}
15+
{{ $is_noindex_true := and (isset .Params "noindex") .Params.noindex }}
16+
{{ if or (in $noindex_kinds .Kind) ($is_noindex_true) }}
17+
<meta name="robots" content="noindex">
18+
{{ end }}
19+
20+
{{ partial "meta/name-author" . }}
21+
{{ template "_internal/opengraph.html" . }}
22+
{{ partial "meta/ogimage" . }}
23+
24+
{{ if .IsHome }} {{ partial "site-verification" . }} {{ end }}
25+
{{ template "_internal/google_analytics.html" . }}
26+
{{ with .OutputFormats.Get "RSS" }}
27+
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
28+
{{ end }}
29+
30+
<link rel="canonical" href="{{ .Permalink }}"> {{ if (isset .Params "prev") }}
31+
<link rel="prev" href="{{ .Params.prev }}"> {{ end }} {{ if (isset .Params "next") }}
32+
<link rel="next" href="{{ .Params.next }}"> {{ end }} {{ partial "favicon" . }}
33+
34+
35+
<link rel="stylesheet" href="/css/bulma.css">
36+
<link rel="stylesheet" href="/css/bulma-divider.min.css">
37+
<link rel="stylesheet" href="/assets/css/bulma-ribbon.min.css">
38+
<link rel="stylesheet" href="/assets/css/tooltip.css">
39+
40+
{{ if .Site.Params.theme_variant }}
41+
<link rel="stylesheet" href="https://jenil.github.io/bulmaswatch/{{.Site.Params.theme_variant.light}}/bulmaswatch.min.css" media="(prefers-color-scheme: light)">
42+
<link rel="stylesheet" href="https://jenil.github.io/bulmaswatch/{{.Site.Params.theme_variant.dark}}/bulmaswatch.min.css" media="(prefers-color-scheme: dark)">
43+
44+
<script type="module" src="https://unpkg.com/dark-mode-toggle"></script>
45+
{{else}}
46+
{{end}}
47+
{{ block "style" .}} {{end}} {{ $lazylist := findRE "class=\".*?\\blazyload\\b.*?\"|class=lazyload\b" .Content }}
48+
<!-- http://regexr.com/3f9d1 -->
49+
{{ if ge (len $lazylist) 1 }}
50+
<script async src="/js/lazysizes.min.js"></script>
51+
{{ end }}
52+
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js"
53+
integrity="sha256-KzZiKy0DWYsnwMF+X1DvQngQ2/FxF7MF3Ff72XcpuPs=" crossorigin="anonymous"></script>
54+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css"
55+
integrity="sha256-h20CPZ0QyXlBuAw7A+KluUYx/3pK+c7lYEpqLTlxjYQ=" crossorigin="anonymous" />
56+
57+
58+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/algoliasearch-lite.umd.js" integrity="sha256-qzlNbRtZWHoUV5I2mI2t9QR7oYXlS9oNctX+0pECXI0=" crossorigin="anonymous"></script>
59+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/instantsearch.production.min.js" integrity="sha256-xUys6KCuRGBxFaRaYZlWulRUjY48XFv6/Q2s0mb1dmc=" crossorigin="anonymous"></script>
60+
61+
62+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
63+
64+
</head>
65+
<!--theme variation-->
66+
67+
<body>
68+
<header>{{ block "header" . }}{{ end }}</header>
69+
<main>{{ block "main" . }}{{ end }}</main>
70+
<footer>{{ block "footer" . }}{{ end }}</footer>
71+
72+
<script async type="text/javascript" src="/js/bulma.js"></script>
73+
74+
<!-- at the end of the BODY -->
75+
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
76+
<script type="text/javascript">
77+
docsearch({
78+
container: '#docsearch',
79+
appId: 'GHN6Q94HKJ',
80+
indexName: 'tools-kausalflow',
81+
apiKey: '2e4aba48a2586d24b6f1e0fe801ac4c9',
82+
placeholder: 'Command + K',
83+
});
84+
</script>
85+
</body>
86+
87+
</html>
File renamed without changes.

layouts/partials/menu.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,20 @@
109109
</a>
110110
{{end}}
111111

112+
113+
<a class="navbar-item">
114+
115+
<dark-mode-toggle
116+
id="dark-mode-toggle-1"
117+
legend=""
118+
appearance="toggle"
119+
dark=" "
120+
light=" "
121+
></dark-mode-toggle>
122+
123+
</a>
124+
125+
112126

113127
</div>
114128

0 commit comments

Comments
 (0)