This commit is contained in:
xaoxuu 2021-03-13 13:32:45 +08:00
parent e392b66506
commit 0835ab6716
6 changed files with 53 additions and 40 deletions

View File

@ -139,7 +139,7 @@ plugins:
# https://scrollrevealjs.org/api/reveal.html # https://scrollrevealjs.org/api/reveal.html
scrollreveal: scrollreveal:
enable: true enable: #true
js: https://cdn.jsdelivr.net/npm/scrollreveal@4.0.9/dist/scrollreveal.min.js js: https://cdn.jsdelivr.net/npm/scrollreveal@4.0.9/dist/scrollreveal.min.js
distance: 8px distance: 8px
duration: 500 # ms duration: 500 # ms

View File

@ -4,11 +4,9 @@ function layoutDiv() {
var title = __('meta.read_next'); var title = __('meta.read_next');
var title_prev = __('meta.read_prev'); var title_prev = __('meta.read_prev');
if (page.layout == 'post') { if (page.layout == 'post') {
prev = page.next; prev = page.prev;
next = page.prev; next = page.next;
title_prev = __('meta.older');
} else if (page.layout == 'wiki' && page.wiki && page.wiki.length > 0) { } else if (page.layout == 'wiki' && page.wiki && page.wiki.length > 0) {
title_prev = __('meta.read_prev');
var wikis = []; var wikis = [];
wikis = site.pages.filter(function (p) { wikis = site.pages.filter(function (p) {
if (p.layout == 'wiki' && p.wiki && p.wiki == page.wiki) { if (p.layout == 'wiki' && p.wiki && p.wiki == page.wiki) {

View File

@ -1,30 +1,39 @@
<div class='widget-wrap' id='recent'>
<div class='widget-header h4 dis-select'>
<span class='name'><%- __('meta.recent_update') %></span>
<% if (item.rss) { %>
<a class='cap-action' id='rss' title='Subscribe' href='<%- item.rss %>'>
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8938"><path d="M800.966 947.251c0-404.522-320.872-732.448-716.69-732.448V62.785c477.972 0 865.44 395.987 865.44 884.466h-148.75z m-162.273 0h-148.74c0-228.98-181.628-414.598-405.678-414.598v-152.01c306.205 0 554.418 253.68 554.418 566.608z m-446.24-221.12c59.748 0 108.189 49.503 108.189 110.557 0 61.063-48.44 110.563-108.188 110.563-59.747 0-108.18-49.5-108.18-110.563 0-61.054 48.433-110.556 108.18-110.556z" p-id="8939"></path></svg>
</a>
<% } %>
</div>
<div class='widget-body fs14'>
<% <%
var arr = page.menu_id == 'wiki' ? site.pages.filter(function(p){ function layoutDiv() {
return p.layout == 'wiki' && p.title && p.title.length > 0; var el = '<div class="widget-wrap" id="recent">';
// header
el += '<div class="widget-header h4 dis-select">';
el += '<span class="name">' + __("meta.recent_update") + '</span>';
if (item.rss) {
el += '<a class="cap-action" id="rss" title="Subscribe" href="' + item.rss + '">';
el += '<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8938"><path d="M800.966 947.251c0-404.522-320.872-732.448-716.69-732.448V62.785c477.972 0 865.44 395.987 865.44 884.466h-148.75z m-162.273 0h-148.74c0-228.98-181.628-414.598-405.678-414.598v-152.01c306.205 0 554.418 253.68 554.418 566.608z m-446.24-221.12c59.748 0 108.189 49.503 108.189 110.557 0 61.063-48.44 110.563-108.188 110.563-59.747 0-108.18-49.5-108.18-110.563 0-61.054 48.433-110.556 108.18-110.556z" p-id="8939"></path></svg>';
el += '</a>';
}
el += '</div>';
// body
var arr = page.menu_id == "wiki" ? site.pages.filter(function(p){
return p.layout == "wiki" && p.title && p.title.length > 0;
}) : site.posts.filter(function(p){ }) : site.posts.filter(function(p){
return p.title && p.title.length > 0; return p.title && p.title.length > 0;
}); });
el += '<div class="widget-body fs14">';
arr.sort("updated", -1).limit(item.limit).each(function(post) {
el += '<div class="post-title reveal">';
el += '<div class="cap">';
el += __("meta.updated") + '&nbsp;' + '<time>' + date(post.updated, config.date_format) + '</time>';
el += '</div>';
el += '<a href="' + url_for(post.link || post.path) + '">';
if (post.wiki && (post.title.toUpperCase().includes(post.wiki.toUpperCase()) == false)) {
el += post.wiki + ': ';
}
el += post.title;
el += '</a>';
el += '</div>';
el += '';
});
el += '</div>';
el += '</div>';
return el;
}
%> %>
<% arr.sort('updated', -1).limit(item.limit).each(function(post){ %> <%- layoutDiv() %>
<div class='post-title'>
<a href="<%= url_for(post.link || post.path) %>">
<% if (post.wiki && (post.title.toUpperCase().includes(post.wiki.toUpperCase()) == false)) { %>
<%- post.wiki ? post.wiki + ': ' : '' %><%- post.title %>
<% } else { %>
<%- post.title %>
<% } %>
</a>
</div>
<% }) %>
</div>
</div>

View File

@ -47,9 +47,15 @@ h6
.widgets .widgets
.post-title .post-title
margin: 0.5rem 0 margin: 0.75rem 0
line-height: 1.2 line-height: 1.2
display: block
txt-ellipsis()
.cap
margin-bottom: 2px
opacity: 0.5
a a
color: inherit color: inherit
font-weight: 500
&:hover &:hover
color: $color-hover color: $color-hover

View File

@ -1,7 +1,7 @@
@require('_defines/const') @require('_defines/const')
// //
$color-theme = #ff7043 $color-theme = #1BCDFC
$color-link = #2196f3 $color-link = #2196f3
$color-button = #1BCDFC $color-button = #1BCDFC
$color-hover = #ff5722 $color-hover = #ff5722
@ -13,8 +13,8 @@ $color-cat-hover = darken($color-cat, 20)
// //
$c-site-bg-light = #f8f8f8 $c-site-bg-light = #f8f8f8
$c-block-light = #f2f2f2 $c-block-light = #f2f2f2
$c-title-light = #111 $c-title-light = #000
$c-text-light = #333 $c-text-light = #222
$c-card-light = white $c-card-light = white
// //

View File

@ -69,7 +69,7 @@ article.md code
color: $color-inlinecode color: $color-inlinecode
font-family: $ff-code font-family: $ff-code
word-break: break-all word-break: break-all
font-size: $fs-p font-size: inherit
background: var(--block) background: var(--block)
padding: 2px padding: 2px
border-radius: 2px border-radius: 2px