diff --git a/_config.yml b/_config.yml
index 66bc7a2..a8bed11 100755
--- a/_config.yml
+++ b/_config.yml
@@ -28,7 +28,7 @@ sidebar:
index: [welcome, recent] # for home/wiki/categories/tags/archives/404 pages
page: [welcome, toc] # for pages using 'layout:page'
post: [toc, ghrepo] # for pages using 'layout:post'
- wiki: [ghrepo, toc, wiki_more] # for pages using 'layout:wiki'
+ wiki: [toc, ghrepo, wiki_more] # for pages using 'layout:wiki'
######## Main ########
diff --git a/_data/widgets.yml b/_data/widgets.yml
index 9032115..5ed9a5a 100644
--- a/_data/widgets.yml
+++ b/_data/widgets.yml
@@ -28,7 +28,8 @@ ghuser:
layout: ghuser
api: https://api.github.com
username: github # your github login username
- avatar: true # true / false
+ avatar: true # show avatar or not
+ menu: true # show menu or not
welcome:
diff --git a/layout/_partial/sidebar/header.ejs b/layout/_partial/sidebar/header.ejs
index c0278e6..6b51076 100644
--- a/layout/_partial/sidebar/header.ejs
+++ b/layout/_partial/sidebar/header.ejs
@@ -1,27 +1,4 @@
<%
-function layoutMenu() {
- var el = '';
- el += '';
- return el;
-}
function layoutDiv() {
var el = '';
el += '';
+ for (let id of Object.keys(theme.sidebar.menu)) {
+ let item = theme.sidebar.menu[id];
+ if (item == undefined || item.length == 0) {
+ continue;
+ }
+ el += '';
+ el += __(md_text(item));
+ el += '';
+ }
+ el += '';
+ return el;
+}
+%>
+
+<%- layoutDiv() %>
diff --git a/layout/_partial/sidebar/widgets/ghrepo.ejs b/layout/_partial/sidebar/widgets/ghrepo.ejs
index f8cf153..3efa084 100644
--- a/layout/_partial/sidebar/widgets/ghrepo.ejs
+++ b/layout/_partial/sidebar/widgets/ghrepo.ejs
@@ -38,9 +38,9 @@ function layoutDiv() {
el += '';
el += '';
el += '';
- el += '
';
+ el += '
';
el += '';
- el += '';
+ el += '0';
el += '
';
el += '
';
el += '';
diff --git a/layout/_partial/sidebar/widgets/ghuser.ejs b/layout/_partial/sidebar/widgets/ghuser.ejs
index ab524d3..24351b4 100644
--- a/layout/_partial/sidebar/widgets/ghuser.ejs
+++ b/layout/_partial/sidebar/widgets/ghuser.ejs
@@ -45,6 +45,10 @@ function layoutDiv() {
el += '';
el += 'Follow';
el += '';
+ // menu
+ if (item.menu) {
+ el += partial('../menu', {where: 'sidebar'});
+ }
el += '';
el += '';
return el;
diff --git a/layout/_partial/sidebar/widgets/toc.ejs b/layout/_partial/sidebar/widgets/toc.ejs
index 641089e..a0d9302 100644
--- a/layout/_partial/sidebar/widgets/toc.ejs
+++ b/layout/_partial/sidebar/widgets/toc.ejs
@@ -15,11 +15,7 @@ function layoutToc() {
function layoutTocHeader(title) {
var el = '';
el += '
';
- if (title) {
- el += '' + title + '';
- } else {
- el += '' + __("meta.toc") + '';
- }
+ el += '' + (title || page.title || __("meta.toc")) + '';
el += '