@@ -5,7 +5,7 @@ import Footer from "../components/Footer.astro";
55import SideBar from " ../components/SideBar.astro" ;
66import { ViewTransitions } from " astro:transitions" ;
77
8- import { SITE_TITLE , SITE_DESCRIPTION , TRANSITION_API } from " ../config" ;
8+ import { SITE_TITLE , SITE_DESCRIPTION , TRANSITION_API , url , BASE_PATH } from " ../config" ;
99
1010const {
1111 image,
@@ -28,6 +28,7 @@ const {
2828 ogType ={ ogType }
2929 />
3030 { TRANSITION_API && <ViewTransitions />}
31+ <Fragment set:html ={ ` <style is:inline>:root{--divider-img:url("${url (' divider_line.png' )}")}</style> ` } />
3132 <script is:inline >
3233 (function(){
3334 var t = localStorage.getItem('theme');
@@ -41,7 +42,7 @@ const {
4142 <input id =" my-drawer" type =" checkbox" class =" drawer-toggle" />
4243 <div class =" drawer-content bg-base-100 rounded-tl-ac-xl relative min-h-screen flex flex-col" >
4344 <div class =" w-full overflow-hidden pointer-events-none select-none" >
44- <img src =" / header_banner_light.png" data-light-src =" / header_banner_light.png" data-dark-src =" / header_banner_dark.png" alt =" " class =" w-full theme-banner" />
45+ <img src ={ url ( ' header_banner_light.png' ) } data-light-src ={ url ( ' header_banner_light.png' ) } data-dark-src ={ url ( ' header_banner_dark.png' ) } alt =" " class =" w-full theme-banner" />
4546 </div >
4647 <Header title ={ SITE_TITLE } />
4748 <div class =" md:flex md:justify-center flex-1" >
@@ -52,7 +53,7 @@ const {
5253 <Footer />
5354
5455 <div class =" w-full overflow-hidden pointer-events-none select-none flex justify-end mt-auto" >
55- <img src =" / banner_light.png" data-light-src =" / banner_light.png" data-dark-src =" / banner_dark.png" alt =" " class =" w-full theme-banner" />
56+ <img src ={ url ( ' banner_light.png' ) } data-light-src ={ url ( ' banner_light.png' ) } data-dark-src ={ url ( ' banner_dark.png' ) } alt =" " class =" w-full theme-banner" />
5657 </div >
5758 </div >
5859 {
@@ -62,6 +63,7 @@ const {
6263 }
6364 </div >
6465 <script is:inline >
66+ var __BASE__ = `${BASE_PATH}`;
6567 function applyTheme(theme) {
6668 document.documentElement.setAttribute('data-theme', theme);
6769 localStorage.setItem('theme', theme);
@@ -70,7 +72,7 @@ const {
7072 });
7173 var icon = document.getElementById('theme-icon');
7274 var label = document.getElementById('theme-label');
73- if (icon) icon.src = theme === 'night' ? '/ leaf_light.png' : '/ leaf_dark.png';
75+ if (icon) icon.src = theme === 'night' ? __BASE__ + ' leaf_light.png' : __BASE__ + ' leaf_dark.png';
7476 if (label) label.textContent = theme === 'night' ? 'Light Mode' : 'Dark Mode';
7577 }
7678 window.toggleTheme = function() {
0 commit comments