sidebar
This commit is contained in:
parent
aa9c2a089b
commit
907f669bf6
|
@ -29,6 +29,7 @@ meta:
|
||||||
updated: 'Updated on'
|
updated: 'Updated on'
|
||||||
license: License
|
license: License
|
||||||
share: Share
|
share: Share
|
||||||
|
repo_info: Repo Info
|
||||||
date_suffix:
|
date_suffix:
|
||||||
just: Just
|
just: Just
|
||||||
min: minutes ago
|
min: minutes ago
|
||||||
|
|
|
@ -29,6 +29,7 @@ meta:
|
||||||
updated: 更新于
|
updated: 更新于
|
||||||
license: 许可协议
|
license: 许可协议
|
||||||
share: 分享文章
|
share: 分享文章
|
||||||
|
repo_info: 项目仓库
|
||||||
date_suffix:
|
date_suffix:
|
||||||
just: 刚刚
|
just: 刚刚
|
||||||
min: 分钟前
|
min: 分钟前
|
||||||
|
|
|
@ -29,6 +29,7 @@ meta:
|
||||||
updated: 更新於
|
updated: 更新於
|
||||||
license: 授權條款
|
license: 授權條款
|
||||||
share: 分享文章
|
share: 分享文章
|
||||||
|
repo_info: 項目倉庫
|
||||||
date_suffix:
|
date_suffix:
|
||||||
just: 剛剛
|
just: 剛剛
|
||||||
min: 分鐘前
|
min: 分鐘前
|
||||||
|
|
|
@ -24,48 +24,32 @@ function layoutWidgets() {
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
function layoutFooterDiv() {
|
function layoutFooterDiv() {
|
||||||
if (theme.footer.social && theme.footer.social.length > 0) {
|
if (page.layout !== 'wiki' && theme.footer.social && theme.footer.social.length > 0) {
|
||||||
var el = '<footer class="footer dis-select">';
|
var el = '<footer class="footer dis-select">';
|
||||||
if (page.layout === 'wiki' && page.wiki && page.menu_id === 'wiki') {
|
el += '<div class="social-wrap">';
|
||||||
const proj = theme.wiki.projects[page.wiki];
|
theme.footer.social.forEach(item => {
|
||||||
if (proj.repo) {
|
if (item.icon && (item.url || item.onclick)) {
|
||||||
el += '<div class="proj-wrap">';
|
el += '<a class="social"';
|
||||||
el += '<a class="item"';
|
if (item.title) {
|
||||||
el += ' title="GitHub"';
|
el += ' title="' + item.title + '"';
|
||||||
el += ' href="' + url_for("https://github.com/" + proj.repo) + '"';
|
|
||||||
el += ' target="_blank" rel="external nofollow noopener noreferrer"';
|
|
||||||
el += '>';
|
|
||||||
el += '<svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1rem" height="1rem" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>';
|
|
||||||
el += 'GitHub';
|
|
||||||
el += '</a>';
|
|
||||||
el += '</div>';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
el += '<div class="social-wrap">';
|
|
||||||
theme.footer.social.forEach(item => {
|
|
||||||
if (item.icon && (item.url || item.onclick)) {
|
|
||||||
el += '<a class="social"';
|
|
||||||
if (item.title) {
|
|
||||||
el += ' title="' + item.title + '"';
|
|
||||||
}
|
|
||||||
if (item.url) {
|
|
||||||
el += ' href="' + url_for(item.url) + '"';
|
|
||||||
if (item.url.includes('://')) {
|
|
||||||
el += ' target="_blank" rel="external nofollow noopener noreferrer"';
|
|
||||||
} else {
|
|
||||||
el += ' rel="noopener noreferrer"';
|
|
||||||
}
|
|
||||||
} else if (item.onclick) {
|
|
||||||
item.onclick = item.onclick.replace(/"|\'/g, '"');
|
|
||||||
el += ' onclick="' + item.onclick + '"';
|
|
||||||
}
|
|
||||||
el += '>';
|
|
||||||
el += item.icon;
|
|
||||||
el += '</a>';
|
|
||||||
}
|
}
|
||||||
});
|
if (item.url) {
|
||||||
el += '</div>';
|
el += ' href="' + url_for(item.url) + '"';
|
||||||
}
|
if (item.url.includes('://')) {
|
||||||
|
el += ' target="_blank" rel="external nofollow noopener noreferrer"';
|
||||||
|
} else {
|
||||||
|
el += ' rel="noopener noreferrer"';
|
||||||
|
}
|
||||||
|
} else if (item.onclick) {
|
||||||
|
item.onclick = item.onclick.replace(/"|\'/g, '"');
|
||||||
|
el += ' onclick="' + item.onclick + '"';
|
||||||
|
}
|
||||||
|
el += '>';
|
||||||
|
el += item.icon;
|
||||||
|
el += '</a>';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
el += '</div>';
|
||||||
el += '</footer>';
|
el += '</footer>';
|
||||||
return el;
|
return el;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -20,13 +20,18 @@ function layoutDiv() {
|
||||||
}
|
}
|
||||||
// 布局
|
// 布局
|
||||||
el += '<div class="widget-wrap" id="repo-info">';
|
el += '<div class="widget-wrap" id="repo-info">';
|
||||||
|
// header
|
||||||
|
el += '<div class="widget-header cap dis-select">';
|
||||||
|
el += '<span class="name">' + __("meta.repo_info") + '</span>';
|
||||||
|
el += '</div>';
|
||||||
|
// body
|
||||||
el += '<div class="widget-body fs14">';
|
el += '<div class="widget-body fs14">';
|
||||||
var items = [];
|
var items = [];
|
||||||
// Readme
|
// GitHub
|
||||||
items.push({
|
items.push({
|
||||||
icon: '<svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1rem" height="1rem" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path fill-rule="evenodd" d="M0 1.75A.75.75 0 01.75 1h4.253c1.227 0 2.317.59 3 1.501A3.744 3.744 0 0111.006 1h4.245a.75.75 0 01.75.75v10.5a.75.75 0 01-.75.75h-4.507a2.25 2.25 0 00-1.591.659l-.622.621a.75.75 0 01-1.06 0l-.622-.621A2.25 2.25 0 005.258 13H.75a.75.75 0 01-.75-.75V1.75zm8.755 3a2.25 2.25 0 012.25-2.25H14.5v9h-3.757c-.71 0-1.4.201-1.992.572l.004-7.322zm-1.504 7.324l.004-5.073-.002-2.253A2.25 2.25 0 005.003 2.5H1.5v9h3.757a3.75 3.75 0 011.994.574z"></path></svg>',
|
icon: '<svg aria-hidden="true" role="img" class="color-icon-primary" viewBox="0 0 16 16" width="1rem" height="1rem" fill="currentColor" style="display:inline-block;user-select:none;vertical-align:text-bottom;overflow:visible"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>',
|
||||||
text: 'Readme',
|
text: 'GitHub',
|
||||||
href: 'https://github.com/' + repo + '#readme'
|
href: 'https://github.com/' + repo
|
||||||
});
|
});
|
||||||
// Releases
|
// Releases
|
||||||
items.push({
|
items.push({
|
||||||
|
@ -47,14 +52,15 @@ function layoutDiv() {
|
||||||
href: 'https://github.com/' + repo + '/issues'
|
href: 'https://github.com/' + repo + '/issues'
|
||||||
});
|
});
|
||||||
items.forEach((item, i) => {
|
items.forEach((item, i) => {
|
||||||
el += '<div class="item"><a class="item-link"';
|
el += '<div class="line"></div>';
|
||||||
|
el += '<a class="item-link"';
|
||||||
el += ' title="' + item.href + '"';
|
el += ' title="' + item.href + '"';
|
||||||
el += ' href="' + url_for(item.href) + '"';
|
el += ' href="' + url_for(item.href) + '"';
|
||||||
el += ' target="_blank" rel="external nofollow noopener noreferrer"';
|
el += ' target="_blank" rel="external nofollow noopener noreferrer"';
|
||||||
el += '>';
|
el += '>';
|
||||||
el += item.icon;
|
el += item.icon;
|
||||||
el += '<span>' + item.text + '</span>';
|
el += '<span>' + item.text + '</span>';
|
||||||
el += '</a></div>';
|
el += '</a>';
|
||||||
});
|
});
|
||||||
el += '</div>';
|
el += '</div>';
|
||||||
el += '</div>';
|
el += '</div>';
|
||||||
|
|
|
@ -20,7 +20,6 @@ function layoutDiv() {
|
||||||
projects.forEach((p, i) => {
|
projects.forEach((p, i) => {
|
||||||
if (p.title !== proj.title) {
|
if (p.title !== proj.title) {
|
||||||
// 同一个分组中的其它项目
|
// 同一个分组中的其它项目
|
||||||
el += '<div class="line"></div>'
|
|
||||||
el += '<a class="more-item wiki" href="' + url_for(p.path) + '">';
|
el += '<a class="more-item wiki" href="' + url_for(p.path) + '">';
|
||||||
el += p.title;
|
el += p.title;
|
||||||
el += '<div class="excerpt">';
|
el += '<div class="excerpt">';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.page-footer
|
.page-footer
|
||||||
margin: 4rem 1rem
|
margin: 4rem 1rem 3rem
|
||||||
color: var(--text-p3)
|
color: var(--text-p3)
|
||||||
a
|
a
|
||||||
color: var(--text-p3)
|
color: var(--text-p3)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
.l_left .footer
|
.l_left .footer
|
||||||
margin-top: 0
|
margin-top: .5rem
|
||||||
margin-bottom: 1rem
|
@media screen and (max-width: $device-tablet)
|
||||||
|
margin-bottom: 1rem
|
||||||
|
|
||||||
.social-wrap
|
.social-wrap
|
||||||
display: grid
|
display: grid
|
||||||
|
|
|
@ -1,19 +1,27 @@
|
||||||
.widget-wrap#repo-info
|
.widget-wrap#repo-info
|
||||||
.widget-body
|
.widget-body
|
||||||
.item
|
border: 1px solid var(--block-border)
|
||||||
margin: 4px 0
|
border-radius: $border-block
|
||||||
a
|
background: var(--block)
|
||||||
|
overflow: hidden
|
||||||
|
.line
|
||||||
|
margin: 0
|
||||||
|
height: 1px
|
||||||
|
background: var(--block-border)
|
||||||
|
&+.line,&:first-child,&:last-child
|
||||||
|
display: none
|
||||||
|
a.item-link
|
||||||
color: var(--text-p2)
|
color: var(--text-p2)
|
||||||
font-weight: 500
|
font-weight: 500
|
||||||
display: inline-flex
|
display: flex
|
||||||
align-items: center
|
align-items: center
|
||||||
padding: 0.25rem .5rem
|
padding: 0.5rem .5rem
|
||||||
border-radius: 4px
|
|
||||||
font-size: $fs-13
|
font-size: $fs-13
|
||||||
|
justify-content: space-between
|
||||||
|
flex-direction: row-reverse
|
||||||
svg
|
svg
|
||||||
margin-right: .5rem
|
|
||||||
width: 1em
|
width: 1em
|
||||||
height: 1em
|
height: 1em
|
||||||
a:hover
|
a:hover
|
||||||
color: var(--text-p1)
|
color: $color-hover
|
||||||
background: var(--block-hover)
|
background: var(--card)
|
||||||
|
|
|
@ -10,6 +10,15 @@
|
||||||
padding-top: "calc(1 * %s)" % var(--gap-l)
|
padding-top: "calc(1 * %s)" % var(--gap-l)
|
||||||
height: "calc(100% - 2 * %s)" % var(--gap-l)
|
height: "calc(100% - 2 * %s)" % var(--gap-l)
|
||||||
|
|
||||||
|
.l_left[layout=wiki]
|
||||||
|
padding-bottom: 0
|
||||||
|
height: "calc(100vh - 2 * %s)" % var(--gap-l)
|
||||||
|
@media screen and (max-width: $device-tablet)
|
||||||
|
height: "calc(100% - 1 * %s)" % var(--gap-l)
|
||||||
|
.widgets >:last-child
|
||||||
|
margin-bottom: 6rem
|
||||||
|
|
||||||
|
|
||||||
.logo-wrap
|
.logo-wrap
|
||||||
margin: 1rem 0 .5rem
|
margin: 1rem 0 .5rem
|
||||||
display: flex
|
display: flex
|
||||||
|
@ -98,8 +107,11 @@
|
||||||
color: $color-hover
|
color: $color-hover
|
||||||
filter: unset !important
|
filter: unset !important
|
||||||
|
|
||||||
|
.l_left nav.menu
|
||||||
|
margin-bottom: 1.5rem
|
||||||
|
|
||||||
nav.menu
|
nav.menu
|
||||||
margin: 1rem 0 .5rem
|
margin: 1rem 0
|
||||||
background: var(--block)
|
background: var(--block)
|
||||||
border-radius: 6px
|
border-radius: 6px
|
||||||
display: flex
|
display: flex
|
||||||
|
@ -131,7 +143,6 @@ nav.menu
|
||||||
flex-grow: 1
|
flex-grow: 1
|
||||||
|
|
||||||
.l_left .widgets
|
.l_left .widgets
|
||||||
margin: 1rem 0
|
|
||||||
overflow: scroll
|
overflow: scroll
|
||||||
flex-grow: 1
|
flex-grow: 1
|
||||||
scrollbar(0, 0)
|
scrollbar(0, 0)
|
||||||
|
@ -172,30 +183,23 @@ nav.menu
|
||||||
>a:hover
|
>a:hover
|
||||||
text-decoration: underline
|
text-decoration: underline
|
||||||
.widget-wrap#recent .widget-body, .widget-wrap#related .widget-body
|
.widget-wrap#recent .widget-body, .widget-wrap#related .widget-body
|
||||||
border: 1px solid var(--block-border)
|
|
||||||
border-radius: $border-block
|
|
||||||
background: var(--block)
|
|
||||||
overflow: hidden
|
|
||||||
.line
|
|
||||||
margin: 0
|
|
||||||
height: 1px
|
|
||||||
background: var(--block-border)
|
|
||||||
&+.line,&:first-child,&:last-child
|
|
||||||
display: none
|
|
||||||
>a
|
>a
|
||||||
padding 0.5rem
|
padding 0.5rem
|
||||||
display: block
|
display: block
|
||||||
line-height: 1.2
|
line-height: 1.2
|
||||||
color: var(--text-p2)
|
color: var(--text-p2)
|
||||||
font-weight: 500
|
font-weight: 500
|
||||||
|
border: 1px solid var(--block-border)
|
||||||
|
border-radius: $border-block
|
||||||
|
margin: 4px 0
|
||||||
|
background: var(--block)
|
||||||
div.cap
|
div.cap
|
||||||
margin-bottom: 0.25rem
|
margin-bottom: 0.25rem
|
||||||
color: var(--text-p4)
|
color: var(--text-p4)
|
||||||
display: flex
|
display: flex
|
||||||
justify-content: space-between
|
justify-content: space-between
|
||||||
&:hover
|
&:hover
|
||||||
color: $color-hover
|
background: var(--block-hover)
|
||||||
background: var(--card)
|
|
||||||
&.wiki
|
&.wiki
|
||||||
font-weight: 700
|
font-weight: 700
|
||||||
div.excerpt
|
div.excerpt
|
||||||
|
@ -207,6 +211,3 @@ nav.menu
|
||||||
-webkit-box-orient: vertical
|
-webkit-box-orient: vertical
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
-webkit-line-clamp: 3
|
-webkit-line-clamp: 3
|
||||||
|
|
||||||
.l_left[layout='wiki'] .widgets
|
|
||||||
margin-top: 0
|
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
background: var(--block)
|
background: var(--block)
|
||||||
overflow: hidden
|
overflow: hidden
|
||||||
border: 1px solid var(--block-border)
|
border: 1px solid var(--block-border)
|
||||||
|
&:first-child
|
||||||
|
margin-top: 0
|
||||||
a.doc-tree-link
|
a.doc-tree-link
|
||||||
color: var(--text-p2)
|
color: var(--text-p2)
|
||||||
padding: 0.5rem
|
padding: 0.5rem
|
||||||
|
|
Loading…
Reference in New Issue