From 7dd9d3665099acb72ac8cfc6cca96fdc3852648c Mon Sep 17 00:00:00 2001
From: weru <onewesh@gmail.com>
Date: Wed, 21 Oct 2020 17:01:36 +0000
Subject: [PATCH] edit template

---
 layouts/_default/baseof.html    |    2 +-
 layouts/shortcodes/picture.html |    6 +++---
 layouts/partials/nav.html       |   10 +++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index e1099b5..ec1689b 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,5 +1,5 @@
 <!doctype html>
-<html lang="{{ .Site.Language.Lang }}"{{ with .Site.Params.darkmode }} class="dim"{{ end }}>
+<html lang="{{ .Site.Language.Lang }}"{{ with .Site.Params.enableDarkmode }} class="dim"{{ end }}>
 <head>
   {{- partial "head" . }}
 </head>
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index 7f47156..37c37d2 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -1,13 +1,13 @@
 <nav class="wrap nav">
 	<a href="{{ .Site.BaseURL }}" class="nav_brand">
-		<picture>
-			{{- $logos := .Site.Params.logo }}
-			{{- $normalPath := absURL (printf "images/%s" $logos.lightMode) }}
-			{{- $darkPath := absURL (printf "images/%s" $logos.darkMode) }}
+		{{- $logos := .Site.Params.logo }}
+		{{- $litPath := absURL (printf "images/%s" $logos.lightMode) }}
+		{{- $darkPath := absURL (printf "images/%s" $logos.darkMode) }}
+		<picture data-lit="{{ $litPath }}" data-dark="{{ $darkPath }}">
 			{{ with .Site.Params.darkmode }}
 			<source srcset = '{{ $darkPath }}' media="(prefers-color-scheme: dark)">
 			{{ end }}
-			<img srcset = '{{ $normalPath }}' alt = '{{ .Site.Title }} Logo'>
+			<img srcset = '{{ $litPath }}' alt = '{{ .Site.Title }} Logo'>
 		</picture>
 		<label class="nav_toggle">Menu</label>
 	</a>
diff --git a/layouts/shortcodes/picture.html b/layouts/shortcodes/picture.html
index 6edce63..6fa8a76 100644
--- a/layouts/shortcodes/picture.html
+++ b/layouts/shortcodes/picture.html
@@ -1,9 +1,9 @@
 {{- $normal := .Get 0 }}
 {{- $dark := .Get 1 }}
 {{- $alt := .Get 2 }}
-{{- $normalPath := absURL (printf "images/%s" $normal) }}
+{{- $litPath := absURL (printf "images/%s" $normal) }}
 {{- $darkPath := absURL (printf "images/%s" $dark) }}
-<picture class="nav_logo">
+<picture class="nav_logo" data-lit="{{ $litPath }}" data-dark="{{ $darkPath }}">
   <source srcset="{{ $darkPath }}" media="(prefers-color-scheme: dark)">
-  <img srcset="{{ $normalPath }}" alt="{{ $alt }}">
+  <img srcset="{{ $litPath }}" alt="{{ $alt }}">
 </picture>

--
Gitblit v1.10.0