-
- <% site.pages.filter(function (p) { %>
- <% return p.layout == 'index' && p.title && p.wiki && p.wiki.includes(post.wiki) %>
- <% }).limit(1).each(function(p) { %>
- <%- p.title %>
- <% }); %>
-
+ <%
+ 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) { %>
+
>
+ <%- cat %>
+
+ <% } %>
<%- post.wiki || post.title %>
<% if (post.description) { %>
<%- post.description %>
diff --git a/layout/_partial/plugins/comments/utterances/layout.ejs b/layout/_partial/plugins/comments/utterances/layout.ejs
index 9152395..cefa5be 100644
--- a/layout/_partial/plugins/comments/utterances/layout.ejs
+++ b/layout/_partial/plugins/comments/utterances/layout.ejs
@@ -23,4 +23,7 @@ function layoutDiv() {
return el;
}
%>
+
+
+
<%- layoutDiv() %>
diff --git a/scripts/helpers/category_color.js b/scripts/helpers/category_color.js
new file mode 100644
index 0000000..f16fe19
--- /dev/null
+++ b/scripts/helpers/category_color.js
@@ -0,0 +1,9 @@
+'use strict';
+
+hexo.extend.helper.register('category_color', function(cat){
+ const cfg = hexo.theme.config;
+ if (cfg.article.category_color && cfg.article.category_color[cat]) {
+ return ' style="color:' + cfg.article.category_color[cat] + '"';
+ }
+ return '';
+});
diff --git a/scripts/helpers/doc_tree.js b/scripts/helpers/doc_tree.js
new file mode 100644
index 0000000..56f7918
--- /dev/null
+++ b/scripts/helpers/doc_tree.js
@@ -0,0 +1,51 @@
+/**
+ * doc_tree(page, {toc: false})
+ */
+
+'use strict';
+
+var util = require('hexo-util');
+
+hexo.extend.helper.register('doc_tree', function(page, args){
+ if (page.layout != 'wiki') {
+ return '';
+ }
+ const pages = hexo.locals.get('pages').filter(function (p) {
+ if (p.layout == 'wiki' && p.wiki && p.wiki == page.wiki && (p.title || p.seo_title)) {
+ if (p.order == undefined) {
+ p.order = 0;
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }).sort('order');
+ if (pages.length == 0) {
+ return '';
+ }
+ var el = '';
+ el += '
';
+ function doc_node(p) {
+ if ((p.title || p.seo_title) && p.permalink) {
+ var node = '
';
+ return node;
+ } else {
+ return '';
+ }
+ }
+ pages.forEach((p, i) => {
+ el += doc_node(p);
+ });
+ el += '
';
+ return el;
+});
diff --git a/source/css/_layout/base.styl b/source/css/_layout/base.styl
index caf0b20..ea97f9f 100644
--- a/source/css/_layout/base.styl
+++ b/source/css/_layout/base.styl
@@ -49,14 +49,10 @@ a.button
font-weight: 600
font-size: $fs12
color: var(--text-p3)
- &.breadcrumb
- color: $color-cat
&.blue
color: darken($color-md-blue, 6)
&.cyan
color: darken($color-mac-cyan, 6)
- &.green
- color: darken($color-mac-green, 4)
span.dot,span.sep
diff --git a/source/css/_layout/main.styl b/source/css/_layout/main.styl
index 90de1d2..0e7e713 100644
--- a/source/css/_layout/main.styl
+++ b/source/css/_layout/main.styl
@@ -15,7 +15,9 @@
.title
font-size: 1.5rem
nav.menu
- margin: -2px
+ margin: -3px
+ a.nav-item
+ margin: 2px
// pc上右边顶部留白
@media screen and (min-width: $device-tablet)
diff --git a/source/css/_layout/navbar.styl b/source/css/_layout/navbar.styl
index 27a1676..e4b83e2 100644
--- a/source/css/_layout/navbar.styl
+++ b/source/css/_layout/navbar.styl
@@ -19,12 +19,11 @@ nav.cap
font-weight: 600
white-space: nowrap
trans1 background
- &:hover
+ &.active,&:hover
background: var(--hover-block)
color: var(--text-p1)
- &.active
- font-weight: 700
- color: inherit
+ a+a
+ margin-left: 4px
.md .tag-plugin.navbar
nav.cap
@@ -51,8 +50,15 @@ nav.cap
display: flex
align-items: center
flex-direction: row
- a.cap:hover
- color: $color-cat-hover
+ &:not([style]) a
+ color: var(--text-p1)
+ &[style] a
+ color: inherit
+ span.sep
+ color: var(--text-p3)
+ // a.cap:hover
+ // color: $color-cat-hover
+ // text-decoration: underline
div#post-meta
margin-top: 2px
diff --git a/source/css/_layout/partial/comments.styl b/source/css/_layout/partial/comments.styl
index 02cb7e2..0b5d075 100644
--- a/source/css/_layout/partial/comments.styl
+++ b/source/css/_layout/partial/comments.styl
@@ -1,8 +1,10 @@
.comments-wrap
padding: $gap * 2 $gap
- div.cmt-body.utterances
- margin: 0 -4px
-
+ div.cmt-body
+ min-height: 150px
+ position: relative
+ svg.loading
+ top: 60px
a.avatar
border-radius: 120px !important
overflow: hidden !important
diff --git a/source/css/_plugins/comments/utterances.styl b/source/css/_plugins/comments/utterances.styl
new file mode 100644
index 0000000..68f4123
--- /dev/null
+++ b/source/css/_plugins/comments/utterances.styl
@@ -0,0 +1,3 @@
+.cmt-body.utterances
+ margin: 0 -4px
+
diff --git a/source/css/_plugins/common/loading.styl b/source/css/_plugins/common/loading.styl
new file mode 100644
index 0000000..74e819a
--- /dev/null
+++ b/source/css/_plugins/common/loading.styl
@@ -0,0 +1,14 @@
+svg.loading
+ display: block
+ position: absolute
+ z-index: -1
+ width: 100%
+ height: 2rem
+ margin: auto
+ animation: spin infinite 2s
+ animation-timing-function: linear
+ @keyframes spin
+ from
+ transform:rotate(0deg)
+ to
+ transform:rotate(360deg)
diff --git a/source/css/_plugins/index.styl b/source/css/_plugins/index.styl
index 1628e6f..3d6c905 100644
--- a/source/css/_plugins/index.styl
+++ b/source/css/_plugins/index.styl
@@ -1,5 +1,12 @@
+// 通用插件
+@import "common/*"
+
// 根据主题配置加载
if hexo-config('plugins.swiper.enable')
@import 'swiper'
if hexo-config('plugins.scrollreveal.enable')
@import 'scrollreveal'
+
+// 评论
+if hexo-config('comments.service') == 'utterances'
+ @import 'comments/utterances'