From 94d5d54c8da796d9e42b4208d8f70d70598c0fb4 Mon Sep 17 00:00:00 2001
From: weru <fromweru@gmail.com>
Date: Tue, 24 Jan 2023 18:36:55 +0000
Subject: [PATCH] refactor picture element #88

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

diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index 238d98a..2d685db 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -6,10 +6,7 @@
 		{{- $litPath := absURL ($logos.lightMode) }}
 		{{- $darkPath := absURL ($logos.darkMode) }}
 		<picture data-lit="{{ $litPath }}" data-dark="{{ $darkPath }}">
-			{{ with $sp.enableDarkMode }}
-			<source srcset = '{{ $darkPath }}' media="(prefers-color-scheme: dark)">
-			{{ end }}
-			<img srcset = '{{ $litPath }}' alt = '{{ $s.Title }} Logo'>
+			<img src="{{ $litPath }}" alt="{{ $s.Title }} Logo">
 		</picture>
 		<label class="nav_toggle toggle" title='{{ T "site_menu" }}' role="button">
 			{{ partial "sprite" (dict "icon" "harmburger") }}
@@ -40,10 +37,7 @@
 					{{- $litPath := absURL ($repo.iconLight) }}
 					{{- $darkPath := absURL ($repo.iconDark) }}
 					<picture data-lit="{{ $litPath }}" data-dark="{{ $darkPath }}">
-						{{ with $sp.enableDarkMode }}
-							<source srcset = '{{ $darkPath }}' media="(prefers-color-scheme: dark)">
-						{{ end }}
-						<img srcset = '{{ $litPath }}' alt = '{{ $repo.name }} Repo'>
+						<img src="{{ $litPath }}" alt="{{ $repo.name }} Repo">
 					</picture>
 				{{ else }}
 					{{ $repo.name }}
diff --git a/layouts/shortcodes/picture.html b/layouts/shortcodes/picture.html
index 6fa8a76..bacaa88 100644
--- a/layouts/shortcodes/picture.html
+++ b/layouts/shortcodes/picture.html
@@ -4,6 +4,5 @@
 {{- $litPath := absURL (printf "images/%s" $normal) }}
 {{- $darkPath := absURL (printf "images/%s" $dark) }}
 <picture class="nav_logo" data-lit="{{ $litPath }}" data-dark="{{ $darkPath }}">
-  <source srcset="{{ $darkPath }}" media="(prefers-color-scheme: dark)">
-  <img srcset="{{ $litPath }}" alt="{{ $alt }}">
+  <img src="{{ $litPath }}" alt="{{ $alt }}">
 </picture>

--
Gitblit v1.10.0