This commit is contained in:
xaoxuu 2021-02-25 20:49:43 +08:00
parent 1432ea8dae
commit dd80bd8026
14 changed files with 51 additions and 59 deletions

View File

@ -26,7 +26,7 @@ sidebar:
# Sidebar widgets # Sidebar widgets
widgets: widgets:
# default layout in home/wiki/categories/tags/archives pages # default layout in home/wiki/categories/tags/archives pages
layout: [welcome, recent] default: [welcome, recent]
# Recent update # Recent update
recent: recent:
layout: recent layout: recent

View File

@ -33,32 +33,32 @@ function layoutDiv() {
} }
}); });
} }
let wrapper = ''; let el = '';
if (prev || next) { if (prev || next) {
wrapper += '<div class="read-next-wrap">'; el += '<div class="related-wrap" id="read-next">';
wrapper += '<section class="header cap cyan">'; el += '<section class="header cap cyan">';
wrapper += '<span>' + title + '</span>'; el += '<span>' + title + '</span>';
wrapper += '</section>'; el += '</section>';
wrapper += '<section class="body">'; el += '<section class="body">';
if (next) { if (next) {
wrapper += '<div class="post-title unread">'; el += '<div class="post-title unread">';
wrapper += '<a href="' + url_for(next.path) + '">'; el += '<a href="' + url_for(next.path) + '">';
wrapper += next.title || next.seo_title || next.wiki; el += next.title || next.seo_title || next.wiki;
wrapper += '</a>'; el += '</a>';
wrapper += '</div>'; el += '</div>';
} }
if (prev) { if (prev) {
wrapper += '<div class="post-title read">'; el += '<div class="post-title read">';
wrapper += '<a href="' + url_for(prev.path) + '">'; el += '<a href="' + url_for(prev.path) + '">';
wrapper += title_prev + __('symbol.colon'); el += title_prev + __('symbol.colon');
wrapper += prev.title || prev.seo_title || prev.wiki; el += prev.title || prev.seo_title || prev.wiki;
wrapper += '</a>'; el += '</a>';
wrapper += '</div>'; el += '</div>';
} }
wrapper += '</section>'; el += '</section>';
wrapper += '</div>'; el += '</div>';
} }
return wrapper; return el;
} }
%> %>
<%- layoutDiv(); %> <%- layoutDiv(); %>

View File

@ -4,7 +4,7 @@ function layoutDiv() {
return ''; return '';
} }
let el = ''; let el = '';
el += '<div class="references-wrap">'; el += '<div class="article-footer">';
if (page.references && page.references.length > 0) { if (page.references && page.references.length > 0) {
el += '<section id="references">'; el += '<section id="references">';
el += '<div class="header">'; el += '<div class="header">';
@ -14,7 +14,7 @@ function layoutDiv() {
page.references.forEach((item, i) => { page.references.forEach((item, i) => {
el += '<li class="post-title">'; el += '<li class="post-title">';
el += '<a href="' + item.url + '">'; el += '<a href="' + item.url + '">';
el += item.title; el += item.title || item.url;
el += '</a>'; el += '</a>';
el += '</li>'; el += '</li>';
}); });

View File

@ -1,4 +1,4 @@
<div class='related-posts-wrap'><%- <div class='related-wrap' id='related-posts'><%-
popular_posts_wrapper({ popular_posts_wrapper({
title: __('meta.related_posts'), title: __('meta.related_posts'),
json: popular_posts_json({ maxCount: 5 , ulClass: 'related-posts' , PPMixingRate: 0.2 , isImage: true , isExcerpt: true} , page ) json: popular_posts_json({ maxCount: 5 , ulClass: 'related-posts' , PPMixingRate: 0.2 , isImage: true , isExcerpt: true} , page )

View File

@ -16,12 +16,12 @@ if (loadComment && page.layout == 'wiki' && page.wiki) {
} }
%> %>
<% if (loadComment) { %> <% if (loadComment) { %>
<article class='comments-wrap' id="comments"> <div class='related-wrap md' id="comments">
<div class='cmt-title cap cyan'> <div class='cmt-title cap cyan'>
<%- page.comment_title != undefined ? page.comment_title : __('meta.comment_title') %> <%- page.comment_title != undefined ? page.comment_title : __('meta.comment_title') %>
</div> </div>
<div class='cmt-body <%- theme.comments.service %>'> <div class='cmt-body <%- theme.comments.service %>'>
<%- partial(theme.comments.service + '/layout') %> <%- partial(theme.comments.service + '/layout') %>
</div> </div>
</article> </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 = theme.sidebar.widgets.layout; page.sidebar = theme.sidebar.widgets.default;
} }
} }
function layoutFooterDiv() { function layoutFooterDiv() {

View File

@ -19,8 +19,8 @@ function layoutTitle() {
<article class='content md <%- post.layout %><%- scrollreveal() %>'> <article class='content md <%- post.layout %><%- scrollreveal() %>'>
<%- layoutTitle() %> <%- layoutTitle() %>
<%- post.content %> <%- post.content %>
</article>
<%- partial('_partial/main/article/references') %> <%- partial('_partial/main/article/references') %>
</article>
<%- partial('_partial/main/article/read_next') %> <%- partial('_partial/main/article/read_next') %>
<%- partial('_partial/main/article/related_posts') %> <%- partial('_partial/main/article/related_posts') %>
<%- partial('_partial/plugins/comments/layout') %> <%- partial('_partial/plugins/comments/layout') %>

View File

@ -29,8 +29,8 @@ function layoutTitle() {
<article class='content md <%- page.layout %><%- scrollreveal() %>'> <article class='content md <%- page.layout %><%- scrollreveal() %>'>
<%- layoutTitle() %> <%- layoutTitle() %>
<%- page.content %> <%- page.content %>
</article>
<%- partial('_partial/main/article/references') %> <%- partial('_partial/main/article/references') %>
</article>
<%- partial('_partial/main/article/read_next') %> <%- partial('_partial/main/article/read_next') %>
<%- partial('_partial/plugins/comments/layout') %> <%- partial('_partial/plugins/comments/layout') %>
<% } %> <% } %>

View File

@ -6,6 +6,7 @@ article.md
line-height: 1.7 line-height: 1.7
article.md.content article.md.content
position: relative
margin-bottom: $gap * 2 margin-bottom: $gap * 2
// titles // titles
@ -48,7 +49,6 @@ article.md
// a // a
article.md article.md
p>a p>a
trans1: color
&:not([class]) &:not([class])
font-weight: 500 font-weight: 500
&:hover &:hover

View File

@ -1,5 +1,5 @@
.references-wrap .md .article-footer
margin: $gap * 2 $gap margin-top: 4rem
padding: 1rem padding: 1rem
background: var(--block) background: var(--block)
border-radius: $border-block border-radius: $border-block
@ -11,7 +11,7 @@
font-size: 1.25rem font-size: 1.25rem
.body .body
input.copy-area input.copy-area
margin-bottom: 0.5rem margin: 0.75rem 0
width: 100% width: 100%
font-family: $ff-code font-family: $ff-code
font-size: $fs12 font-size: $fs12
@ -19,32 +19,35 @@
font-size: $fs14 font-size: $fs14
color: var(--text-p2) color: var(--text-p2)
margin: 1em 0 margin: 1em 0
&:first-child a
margin-top: 0 font-weight: 400
&:last-child
margin-bottom: 0
ul ul
margin: 0 margin: 0
overflow: hidden
a:hover
text-decoration: underline
.post-title .post-title
margin: 0.5rem 0 margin: 0.5rem 0
line-height: 1.2 line-height: 1.2
font-size: $fs14 font-size: $fs14
word-break: break-all
section+section section+section
margin-top: 1rem margin-top: 1rem
padding-top: 1rem padding-top: 1rem
border-top: 1px solid var(--block-border) border-top: 1px solid var(--block-border)
.references-wrap .social-wrap .md .article-footer .social-wrap
grid-gap: $gap * 0.25 $gap * 0.5 grid-gap: $gap * 0.25 $gap * 0.5
grid-template-columns: repeat(auto-fill, 40px) grid-template-columns: repeat(auto-fill, 40px)
margin-bottom: 0.5rem
a.social a.social
padding: 8px padding: 8px
.references-wrap .qrcode .md .article-footer .qrcode
margin: 2rem auto 1rem margin: 2rem auto 1rem
width: 128px width: 128px
img img
object-fit: contain object-fit: contain
.references-wrap .qrcode.display .md .article-footer .qrcode.display
display: block !important display: block !important

View File

@ -1,5 +1,4 @@
.comments-wrap .related-wrap#comments
padding: $gap * 2 $gap
div.cmt-body div.cmt-body
min-height: 150px min-height: 150px
position: relative position: relative

View File

@ -1,5 +1,4 @@
.read-next-wrap .related-wrap#read-next
padding: $gap * 2 $gap
.body .body
.post-title .post-title
margin: 0.5rem 0 margin: 0.5rem 0
@ -14,7 +13,7 @@
font-weight: 500 font-weight: 500
&.unread &.unread
color: var(--text-p1) color: var(--text-p1)
font-size: 2rem font-size: 1.75rem
font-weight: 400 font-weight: 400
@media screen and (max-width: $device-mobile) @media screen and (max-width: $device-mobile)
font-size: 1.5rem font-size: 1.5rem

View File

@ -1,7 +1,4 @@
div.related-posts-wrap .related-wrap#related-posts
padding: $gap * 2 $gap
&:empty
display: none
.related-posts .related-posts
width: 100% width: 100%
display: flex display: flex
@ -64,13 +61,3 @@ div.related-posts-wrap
transform: scale(1.04) transform: scale(1.04)
a+a a+a
margin-left: $gap margin-left: $gap
// // iPad
// @media screen and (max-width: $device-tablet)
// section.related-posts-wrap
// .related-posts
// a
// min-width: 280px
// .img
// height: 120px

View File

@ -0,0 +1,4 @@
.related-wrap
padding: $gap * 2 $gap
&:empty
display: none