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/
# Sidebar widgets
widgets:
# default layout in home/wiki/categories/tags/archives pages
layout: [welcome, recent]
# Recent update
recent:
layout: recent

View File

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

View File

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

View File

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

View File

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

View File

@ -25,19 +25,6 @@ nav.cap
a+a
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

View File

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

View File

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

View File

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

View File

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

View File

@ -125,7 +125,7 @@ nav.menu
line-height: 0
.social-wrap
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)
a
display: inline-block

View File

@ -42,7 +42,7 @@
color: $color-hover
background: none
a+a
margin-left: 1rem
margin-left: 1.5rem
.about-header+.about-body
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
display: block
position: absolute
color: var(--text-p3)
z-index: -1
width: 100%
height: 2rem