mirror of
https://github.com/13hannes11/hugo-coder-timeline.git
synced 2024-09-04 00:50:58 +02:00
Add theme toggle button feature (#358)
* Add theme toggle button feature * Add theme toggle button feature * Replaced svg icon with FA icon + fixed indentation + refactored css * Added back colorsheme configurations + script moved to be process by hugo pipe * Make release * Fix toggle button not working when loading new page + setTheme() refactor * Make release * Update exampleSite/config.toml Co-authored-by: Luiz F. A. de Prá <luizdepra@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
b3237d1ead
commit
be7b79af62
@@ -89,7 +89,7 @@
|
||||
|
||||
{{ hugo.Generator }}
|
||||
</head>
|
||||
|
||||
|
||||
{{ $csClass := "colorscheme-light" }}
|
||||
{{ if eq .Site.Params.colorscheme "dark" }}
|
||||
{{ $csClass = "colorscheme-dark" }}
|
||||
@@ -109,6 +109,14 @@
|
||||
{{ partial "footer.html" . }}
|
||||
</main>
|
||||
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $script := resources.Get "js/dark-mode.js" }}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ else }}
|
||||
{{ $script := resources.Get "js/dark-mode.js" | minify | fingerprint }}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.custom_js }}
|
||||
<script src="{{ . | relURL }}"></script>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user