diff --git a/_config.yml b/_config.yml index e432754..34ed16f 100755 --- a/_config.yml +++ b/_config.yml @@ -19,14 +19,14 @@ sidebar: avatar: '[config.avatar](/about/)' # you can set avatar link in _config.yml or '[https://xxx.png](/about/)' title: '[config.title](/)' # you can set html tag like: '[](/)' menu: - post: '[btn.blog](/)' - wiki: '[btn.wiki](/wiki/)' + post: # '[btn.blog](/)' + wiki: # '[btn.wiki](/wiki/)' friends: # '[友链](/friends/)' about: # '[关于](/about/)' # Sidebar widgets widgets: # default layout in home/wiki/categories/tags/archives pages - default: [welcome, recent] + default: # [welcome, recent] # Recent update recent: layout: recent diff --git a/scripts/events/lib/config.js b/scripts/events/lib/config.js index 0de8f90..d45a64f 100644 --- a/scripts/events/lib/config.js +++ b/scripts/events/lib/config.js @@ -31,8 +31,14 @@ module.exports = hexo => { } } - + // default menu + if (hexo.theme.config.sidebar.menu == undefined) { + hexo.theme.config.sidebar.menu = []; + } // default widgets + if (hexo.theme.config.sidebar.widgets.default == undefined) { + hexo.theme.config.sidebar.widgets.default = ['welcome', 'recent']; + } if (hexo.theme.config.sidebar.widgets.wiki_more == undefined) { hexo.theme.config.sidebar.widgets.wiki_more = {layout: 'wiki_more'}; }