File tree Expand file tree Collapse file tree 6 files changed +16
-17
lines changed
Expand file tree Collapse file tree 6 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -467,6 +467,6 @@ <h2 class="title is-size-3 is-size-4-mobile is-spaced">Try the demo</h2>
467467 < script >
468468 const featuresBasePath = "{{ SITEURL }}/features/" ;
469469 </ script >
470- < script src ="{{ SITEURL }}/theme/js/index-top-feature.js "> </ script >
470+ < script src ="{{ SITEURL }}/theme/js/index.min.js?v=1 "> </ script >
471471 </ body >
472472</ html >
Load Diff This file was deleted.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -31,3 +31,14 @@ document.addEventListener("DOMContentLoaded", () => {
3131 } ) ;
3232 } ) ;
3333} ) ;
34+
35+ // Dark theme: apply theme based on stored preference or system setting
36+ const storedTheme = localStorage . getItem ( "theme" ) ;
37+ if ( storedTheme ) {
38+ document . documentElement . setAttribute ( "data-theme" , storedTheme ) ;
39+ } else if ( window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches ) {
40+ document . documentElement . classList . add ( "dark" ) ;
41+ document . documentElement . setAttribute ( "data-theme" , "dark" ) ;
42+ } else {
43+ document . documentElement . setAttribute ( "data-theme" , "light" ) ;
44+ }
Original file line number Diff line number Diff line change 1111 "build:js" : " babel js/*.js js/activity/feed.js --out-dir theme/static/js && concat js/activity/*.min.js theme/static/js/feed.js -o theme/static/js/activity.js && rm theme/static/js/feed.js" ,
1212 "minify:activity" : " terser theme/static/js/activity.js --config-file .terserrc -o theme/static/js/activity.min.js" ,
1313 "minify:theme" : " terser theme/static/js/theme.js --config-file .terserrc -o theme/static/js/theme.min.js" ,
14- "minify:dark-theme" : " terser theme/static/js/dark-theme.js --config-file .terserrc -o theme/static/js/dark-theme.min.js" ,
1514 "minify:faq" : " terser theme/static/js/faq.js --config-file .terserrc -o theme/static/js/faq.min.js" ,
1615 "minify:modal" : " terser theme/static/js/modal.js --config-file .terserrc -o theme/static/js/modal.min.js" ,
17- "minify:top-feature " : " terser theme/static/js/index-top-feature .js --config-file .terserrc -o theme/static/js/index-top-feature .min.js" ,
18- "minify" : " npm run minify:activity && npm run minify:theme && npm run minify:dark-theme && npm run minify: faq && npm run minify:modal && npm run minify:top-feature " ,
16+ "minify:index " : " terser theme/static/js/index.js --config-file .terserrc -o theme/static/js/index.min.js" ,
17+ "minify" : " npm run minify:activity && npm run minify:theme && npm run minify:faq && npm run minify:modal && npm run minify:index " ,
1918 "build" : " npm run build:css && npm run build:js && npm run minify" ,
2019 "serve" : " http-server -a 0.0.0.0 -p 8080 ./output/" ,
2120 "start" : " concurrently \" npm run serve\" \" npm run build:sass\" \" npm run build:postcss\" " ,
Original file line number Diff line number Diff line change 1414 content ="width=device-width, initial-scale=1, shrink-to-fit=no "
1515 />
1616 {% block extra_meta %}{% endblock %}
17- < link rel ="stylesheet " href ="{{ SITEURL }}/theme/css/theme.css?v=2 " />
17+ < link rel ="stylesheet " href ="{{ SITEURL }}/theme/css/theme.min. css?v=1 " />
1818 < link
1919 rel ="icon "
2020 type ="image/x-icon "
9090 title ="{{ SITENAME|striptags }} Tags RSS Feed "
9191 />
9292 {% endif %}
93- < script src ="{{ SITEURL }}/theme/js/dark-theme.min.js?v=1 "> </ script >
9493 < meta name ="generator " content ="Pelican " />
9594 {% endblock head %}
9695 </ head >
230229 </ div >
231230 </ div >
232231 </ footer >
233- < script src ="{{ SITEURL }}/theme/js/theme.min.js?v=1 " defer > </ script >
232+ < script src ="{{ SITEURL }}/theme/js/theme.min.js?v=2 " defer > </ script >
234233 {% block scripts %}{% endblock %}
235234 {% if MATOMO_SITE_ID %}
236235 <!-- Matomo -->
You can’t perform that action at this time.
0 commit comments