tangkunyin/hexo-theme-jsimple

How to set the default theme to 'night-mode'?

Closed this issue · 3 comments

I found that there is 'switchReadMode' function to switch the theme in SimpleCore.js.
I wonder that except for the setting in init function, is there a graceful way to set the default theme to 'night-mode'?

@longqzh Good idea. I consider that add this feature in next version and make it configurable. You can change the SimpleCore.js for this so far....

I added the code as below at the end of SimpleCore.js

$(function(){
	if ((SimpleCore.getLocalData('read-mode') != 'night')&&(SimpleCore.getLocalData('read-mode') != 'day')) { // null 
		SimpleCore.switchReadMode();
	}
})

It works properly, but i'm not very sure it's a graceful way :)

@longqzh This have been support in version 0.0.8. You can have a try....