Added theme selector to the posts navbar.

This commit is contained in:
donfiguerres 2022-06-03 18:34:03 +08:00
parent 2ccdb57c26
commit 45361fc63e
5 changed files with 6 additions and 13 deletions

View file

@ -18,11 +18,6 @@
<div class="container-fluid bg-dimmed wrapper">
<!-- INITIALIZE DARK THEME -->
{{ if site.Params.darkTheme.enable }}
{{ partial "helpers/darkmode.html" }}
{{ end }}
<!----- ADD NAVBAR --------------->
{{ block "navbar" . }} {{ end }}

View file

@ -34,11 +34,6 @@
</head>
<body data-spy="scroll" data-target="#top-navbar" data-offset="100">
<!-- INITIALIZE DARK THEME -->
{{ if site.Params.darkTheme.enable }}
{{ partial "helpers/darkmode.html" }}
{{ end }}
<!--- NAVBAR ------------------------->
{{- partial "navigators/navbar.html" . -}}

View file

@ -1,3 +0,0 @@
<!-- This is a 'hack' for initializing the color scheme selection. See /js/darkmode.js -->
<div id="themeInitialization" style="display: none;"
default-theme=" {{ site.Params.darkTheme.default }} "></div>

View file

@ -47,6 +47,9 @@
{{ if .IsTranslated }}
{{ partial "navigators/lang-selector-2.html" . }}
{{ end }}
{{ if site.Params.darkTheme.enable }}
{{ partial "navigators/theme-selector.html" . }}
{{ end }}
</ul>
</div>
</div>

View file

@ -1,4 +1,7 @@
<li class="nav-item dropdown">
<!-- This is a 'hack' for initializing the color scheme selection. See /js/darkmode.js -->
<div id="themeInitialization" style="display: none;"
default-theme=" {{ site.Params.darkTheme.default }} "></div>
<a class="nav-link dropdown-toggle" href="#" id="themeSelector" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Theme</a>
<div class="dropdown-menu" aria-labelledby="themeSelector">