This commit is contained in:
xaoxuu 2021-02-24 00:32:07 +08:00
parent 3bf7f894d3
commit 917bf99170
14 changed files with 65 additions and 80 deletions

View File

@ -35,6 +35,8 @@ sidebar:
url: /about/ url: /about/
# Sidebar widgets # Sidebar widgets
widgets: widgets:
# default layout in home/wiki/categories/tags/archives pages
layout: [welcome, recent]
# Recent update # Recent update
recent: recent:
layout: recent layout: recent

View File

@ -13,21 +13,12 @@ function layoutWikiCover() {
var el = ''; var el = '';
el += '<div class="l_cover' + scrollreveal() + '">'; el += '<div class="l_cover' + scrollreveal() + '">';
el += '<article class="cover-wrap md">'; el += '<article class="cover-wrap md">';
if (page.logo && cover.includes('logo')) { if (page.logo && page.logo.src && cover.includes('logo')) {
el += '<div class="logo">'; el += '<div class="preview">';
var height = ''; if (page.logo.large) {
var src = ''; el += '<img src="' + page.logo.src + '" height="' + page.logo.large + '">';
page.logo.split(' ').forEach(function(item) {
if (item.includes('px')) {
height = item;
} else {
src = item;
}
});
if (height.length > 0) {
el += '<img src="' + src + '" height="' + height + '">';
} else { } else {
el += '<img src="' + src + '">'; el += '<img src="' + page.logo.src + '">';
} }
el += '</div>'; el += '</div>';
} }

View File

@ -1,44 +1,31 @@
<% if (post.logo) { %> <%
<% function layoutDiv() {
var arr = post.logo.split(' '); var el = '';
var height = ''; if (post.logo && post.logo.src) {
var src = ''; el += '<div class="preview">';
arr.forEach(function(item) { el += '<img src="' + post.logo.src + '" alt="logo"';
var px = item.match(/[0-9]*px/i); if (post.logo.small) {
if (px && px.length > 0) { el += ' height="' + post.logo.small + '"';
px = px[0];
height = px;
} else {
src = item;
} }
}); el += '/>';
%> el += '</div>';
<div class='logo'> }
<% if (height.length > 0) { %> el += '<div class="excerpt">';
<img src='<%- src %>' alt='logo' height='<%- height %>'>
<% } else { %>
<img src='<%- src %>' alt='logo'>
<% } %>
</div>
<% } %>
<div class='excerpt'>
<%
var cat = ''; var cat = '';
site.pages.filter(function (p) { site.pages.filter(function (p) {
return p.layout == 'index' && p.title && p.wiki && p.wiki.includes(post.wiki) return p.layout == 'index' && p.title && p.wiki && p.wiki.includes(post.wiki)
}).limit(1).each(function(p) { }).limit(1).each(function(p) {
cat = p.title; cat = p.title;
}); });
%> if (cat) {
<% if (cat) { %> el += '<div class="cap breadcrumb"' + category_color(cat) + '>';
<div class='cap breadcrumb'<%- category_color(cat) %>> el += '<span>' + cat + '</span>';
<span><%- cat %></span> el += '</div>';
</div> }
<% } %> el += '<h2 class="post-title">' + (post.wiki || post.title || post.seo_title) + '</h2>';
<h2 class='post-title'><%- post.wiki || post.title %></h2> el += '<p>' + post.description + '</p>';
<% if (post.description) { %> el += '</div>';
<p><%- post.description %></p> return el;
<% } else if (post.excerpt) { %> }
<%- strip_html(post.excerpt) %> %>
<% } %> <%- layoutDiv() %>
</div>

View File

@ -6,7 +6,7 @@ if (page.sidebar == undefined) {
} else if (page.layout == 'wiki' && page.content) { } else if (page.layout == 'wiki' && page.content) {
page.sidebar = ['toc', 'wiki_more']; page.sidebar = ['toc', 'wiki_more'];
} else { } else {
page.sidebar = ['welcome', 'recent']; page.sidebar = theme.sidebar.widgets.layout;
} }
} }
function layoutFooterDiv() { function layoutFooterDiv() {

View File

@ -109,7 +109,7 @@ ol ul, ol ol
table:not([class]) table:not([class])
border-collapse: collapse border-collapse: collapse
overflow: auto overflow: auto
display: inline-block margin: 1rem 0
max-width: 100% max-width: 100%
vertical-align: text-top vertical-align: text-top
th th

View File

@ -25,19 +25,6 @@ nav.cap
a+a a+a
margin-left: 4px margin-left: 4px
.md .tag-plugin.navbar
nav.cap
margin: 0
padding: 1px
background: var(--block)
border-radius: 6px
a
margin: 1px
padding: 0.5em 0.75rem
&:hover
background: #fff
color: var(--text-p1)
// //
.breadcrumb-navigation .breadcrumb-navigation

View File

@ -9,12 +9,14 @@
.l_cover .cover-wrap .l_cover .cover-wrap
margin-bottom: 0 margin-bottom: 0
max-width: 500px max-width: 500px
.logo .preview
margin-bottom: 2rem margin-bottom: 2rem
img img
object-fit: contain object-fit: contain
max-height: 35vh max-height: 35vh
max-width: 100% max-width: 100%
@media screen and (max-width: 500px)
max-width: 60%
.cover-title .cover-title
font-weight: 700 font-weight: 700
font-size: 1.5rem font-size: 1.5rem

View File

@ -12,6 +12,6 @@
color: $color-hover color: $color-hover
&.read &.read
color: var(--text-p3) color: var(--text-p3)
font-size: $fs12 font-size: $fs14
&.unread &.unread
font-size: $fsh2 font-size: 1.75rem

View File

@ -22,8 +22,8 @@ div.related-posts-wrap
flex-direction: column flex-direction: column
overflow: hidden overflow: hidden
width: 360px width: 360px
opacity: 0.7 // opacity: 0.7
trans1: opacity 0.5s
border: 1px solid var(--hover-block) border: 1px solid var(--hover-block)
.img .img
height: 180px height: 180px
@ -32,6 +32,7 @@ div.related-posts-wrap
width: 100% width: 100%
height: 100% height: 100%
object-fit: cover object-fit: cover
trans1: transform 1s
@media screen and (max-width: $device-tablet) @media screen and (max-width: $device-tablet)
width: 300px width: 300px
.img .img
@ -56,7 +57,8 @@ div.related-posts-wrap
overflow: hidden overflow: hidden
-webkit-line-clamp: 3 -webkit-line-clamp: 3
&:hover &:hover
opacity: 1 img
transform: scale(1.04)
a+a a+a
margin-left: $gap margin-left: $gap

View File

@ -29,7 +29,7 @@
margin-left: 0.5rem margin-left: 0.5rem
.post-list .post-card:hover .post-list .post-card:hover
box-shadow: 0 2px 8px 0px rgba(0, 0, 0, 0.04), 0 4px 16px 0px rgba(0, 0, 0, 0.04) box-shadow: 0 2px 8px 0px rgba(0, 0, 0, 0.04), 0 4px 16px 0px rgba(0, 0, 0, 0.04)
.logo img .preview img
transform: scale(1.1) transform: scale(1.1)
.excerpt .readmore .excerpt .readmore
color: $color-link color: $color-link
@ -85,9 +85,9 @@
justify-content: center justify-content: center
.post-list .post-card.wiki article .logo .post-list .post-card.wiki article .preview
display: flex display: flex
width: 180px width: 200px
margin: 1rem margin: 1rem
align-items: center align-items: center
img img
@ -99,9 +99,10 @@
flex: 1 flex: 1
overflow: hidden overflow: hidden
word-wrap: break-word word-wrap: break-word
.title .post-title
font-weight: 600 margin-top: 0.5rem
font-size: $fs-h3 font-weight: 500
font-size: 1.75rem
>p >p
margin: 0.5rem 0 margin: 0.5rem 0
font-size: $fs14 font-size: $fs14

View File

@ -125,7 +125,7 @@ nav.menu
line-height: 0 line-height: 0
.social-wrap .social-wrap
display: grid display: grid
grid-gap: $gap * 0.5 $gap * 0.5 grid-gap: $gap * 0.25 $gap * 0.25
grid-template-columns: repeat(auto-fill, 32px) grid-template-columns: repeat(auto-fill, 32px)
a a
display: inline-block display: inline-block

View File

@ -42,7 +42,7 @@
color: $color-hover color: $color-hover
background: none background: none
a+a a+a
margin-left: 1rem margin-left: 1.5rem
.about-header+.about-body .about-header+.about-body
margin-top: 1.5rem margin-top: 1.5rem

View File

@ -0,0 +1,12 @@
.md .tag-plugin.navbar
nav.cap
margin: 0
padding: 1px
background: var(--block)
border-radius: 6px
a
margin: 1px
padding: 0.5em 0.75rem
&:hover
background: #fff
color: var(--text-p1)

View File

@ -1,6 +1,7 @@
svg.loading svg.loading
display: block display: block
position: absolute position: absolute
color: var(--text-p3)
z-index: -1 z-index: -1
width: 100% width: 100%
height: 2rem height: 2rem