From 0835ab67163ed7bf35f4abbcb58582681277aad6 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Sat, 13 Mar 2021 13:32:45 +0800 Subject: [PATCH] update --- _config.yml | 2 +- layout/_partial/main/article/read_next.ejs | 6 +- layout/_partial/sidebar/widgets/recent.ejs | 69 ++++++++++++---------- source/css/_common/title.styl | 8 ++- source/css/_custom.styl | 6 +- source/css/_layout/md.styl | 2 +- 6 files changed, 53 insertions(+), 40 deletions(-) diff --git a/_config.yml b/_config.yml index 453b7b1..5552e27 100755 --- a/_config.yml +++ b/_config.yml @@ -139,7 +139,7 @@ plugins: # https://scrollrevealjs.org/api/reveal.html scrollreveal: - enable: true + enable: #true js: https://cdn.jsdelivr.net/npm/scrollreveal@4.0.9/dist/scrollreveal.min.js distance: 8px duration: 500 # ms diff --git a/layout/_partial/main/article/read_next.ejs b/layout/_partial/main/article/read_next.ejs index a613427..0a19ec7 100644 --- a/layout/_partial/main/article/read_next.ejs +++ b/layout/_partial/main/article/read_next.ejs @@ -4,11 +4,9 @@ function layoutDiv() { var title = __('meta.read_next'); var title_prev = __('meta.read_prev'); if (page.layout == 'post') { - prev = page.next; - next = page.prev; - title_prev = __('meta.older'); + prev = page.prev; + next = page.next; } else if (page.layout == 'wiki' && page.wiki && page.wiki.length > 0) { - title_prev = __('meta.read_prev'); var wikis = []; wikis = site.pages.filter(function (p) { if (p.layout == 'wiki' && p.wiki && p.wiki == page.wiki) { diff --git a/layout/_partial/sidebar/widgets/recent.ejs b/layout/_partial/sidebar/widgets/recent.ejs index 5c6dbbb..f8f8787 100644 --- a/layout/_partial/sidebar/widgets/recent.ejs +++ b/layout/_partial/sidebar/widgets/recent.ejs @@ -1,30 +1,39 @@ -
-
- <%- __('meta.recent_update') %> - <% if (item.rss) { %> - - - - <% } %> -
-
- <% - 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){ - return p.title && p.title.length > 0; - }); - %> - <% arr.sort('updated', -1).limit(item.limit).each(function(post){ %> -
- - <% if (post.wiki && (post.title.toUpperCase().includes(post.wiki.toUpperCase()) == false)) { %> - <%- post.wiki ? post.wiki + ': ' : '' %><%- post.title %> - <% } else { %> - <%- post.title %> - <% } %> - -
- <% }) %> -
-
+<% +function layoutDiv() { + var el = '
'; + // header + el += '
'; + el += '' + __("meta.recent_update") + ''; + if (item.rss) { + el += ''; + el += ''; + el += ''; + } + el += '
'; + // 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){ + return p.title && p.title.length > 0; + }); + el += '
'; + arr.sort("updated", -1).limit(item.limit).each(function(post) { + el += '
'; + el += '
'; + el += __("meta.updated") + ' ' + ''; + el += '
'; + el += ''; + if (post.wiki && (post.title.toUpperCase().includes(post.wiki.toUpperCase()) == false)) { + el += post.wiki + ': '; + } + el += post.title; + el += ''; + el += '
'; + el += ''; + }); + el += '
'; + el += '
'; + return el; +} +%> +<%- layoutDiv() %> diff --git a/source/css/_common/title.styl b/source/css/_common/title.styl index cac236b..30e5a04 100644 --- a/source/css/_common/title.styl +++ b/source/css/_common/title.styl @@ -47,9 +47,15 @@ h6 .widgets .post-title - margin: 0.5rem 0 + margin: 0.75rem 0 line-height: 1.2 + display: block + txt-ellipsis() + .cap + margin-bottom: 2px + opacity: 0.5 a color: inherit + font-weight: 500 &:hover color: $color-hover diff --git a/source/css/_custom.styl b/source/css/_custom.styl index 0a58588..5eb31c8 100644 --- a/source/css/_custom.styl +++ b/source/css/_custom.styl @@ -1,7 +1,7 @@ @require('_defines/const') // 通用主题色 -$color-theme = #ff7043 +$color-theme = #1BCDFC $color-link = #2196f3 $color-button = #1BCDFC $color-hover = #ff5722 @@ -13,8 +13,8 @@ $color-cat-hover = darken($color-cat, 20) // 浅色页面 $c-site-bg-light = #f8f8f8 $c-block-light = #f2f2f2 -$c-title-light = #111 -$c-text-light = #333 +$c-title-light = #000 +$c-text-light = #222 $c-card-light = white // 深色页面 diff --git a/source/css/_layout/md.styl b/source/css/_layout/md.styl index e9b1be6..a871774 100644 --- a/source/css/_layout/md.styl +++ b/source/css/_layout/md.styl @@ -69,7 +69,7 @@ article.md code color: $color-inlinecode font-family: $ff-code word-break: break-all - font-size: $fs-p + font-size: inherit background: var(--block) padding: 2px border-radius: 2px