diff --git a/_config.yml b/_config.yml index 845d02d..fe4dfda 100755 --- a/_config.yml +++ b/_config.yml @@ -25,10 +25,10 @@ sidebar: # about: '[关于](/about/)' # Sidebar widgets widgets: - index: [welcome, recent, timeline] # for home/wiki/categories/tags/archives/404 pages - page: [welcome, toc] # for pages using 'layout:page' - post: [toc, ghrepo, ghissues] # for pages using 'layout:post' - wiki: [toc, ghrepo, ghissues, related] # for pages using 'layout:wiki' + index: welcome, recent, timeline # for home/wiki/categories/tags/archives/404 pages + page: welcome, toc # for pages using 'layout:page' + post: toc, ghrepo, ghissues # for pages using 'layout:post' + wiki: toc, ghrepo, ghissues, related # for pages using 'layout:wiki' ######## Index ######## post-index: # 近期发布 分类 标签 归档 and ... diff --git a/layout/_partial/sidebar/index.ejs b/layout/_partial/sidebar/index.ejs index d9777aa..c01377d 100755 --- a/layout/_partial/sidebar/index.ejs +++ b/layout/_partial/sidebar/index.ejs @@ -18,6 +18,12 @@ if (page.sidebar == undefined) { page.sidebar = []; } } + +// parse array string +if (typeof page.sidebar == 'string') { + page.sidebar = page.sidebar.replace(/ /g, '').split(','); +} + function layoutWidgets() { var el = ''; el += '
';