chore: optimize directory structure
This commit is contained in:
parent
efe9d9b64b
commit
136359bf00
|
@ -188,7 +188,7 @@ rss:
|
|||
# 评论插件
|
||||
# 主题内置了 Valine 和 Gitalk,只能使用其中一款。
|
||||
# ---------------------------------------------------------------------------------------
|
||||
comments:
|
||||
comment:
|
||||
# Valine
|
||||
# See: https://github.com/xCss/Valine
|
||||
# 如何使用 Valine,请参考官方教程:https://github.com/xCss/Valine
|
||||
|
@ -430,7 +430,7 @@ top: 9999
|
|||
hexo new page about
|
||||
```
|
||||
2. 创建成功后,打开博客目录下 `/source/about/index.md` 文件,即可填写自己的内容。
|
||||
支持 Markdown 和 HTML 格式;`comments: true` 表示该页面开启评论功能。
|
||||
支持 Markdown 和 HTML 格式;`comment: true` 表示该页面开启评论功能。
|
||||
|
||||
参考如下示例:
|
||||
|
||||
|
@ -438,7 +438,7 @@ top: 9999
|
|||
---
|
||||
title: about
|
||||
date: 2020-03-19 14:59:53
|
||||
comments: true
|
||||
comment: true
|
||||
---
|
||||
|
||||
## About me
|
||||
|
|
|
@ -46,7 +46,7 @@ rss:
|
|||
# ---------------------------------------------------------------------------------------
|
||||
# Comment plugin
|
||||
# ---------------------------------------------------------------------------------------
|
||||
comments:
|
||||
comment:
|
||||
# Valine
|
||||
# See: https://github.com/xCss/Valine
|
||||
valine:
|
||||
|
|
|
@ -15,7 +15,6 @@ tag: Tag
|
|||
tags: Tags
|
||||
tagcloud: Tag Cloud
|
||||
comment: Comment
|
||||
comments: Comments
|
||||
home: Home
|
||||
archive: Archive
|
||||
archives: Archives
|
||||
|
|
|
@ -14,8 +14,7 @@ categories: 分类
|
|||
tag: 标签
|
||||
tags: 标签
|
||||
tagcloud: 标签云
|
||||
comment: 留言
|
||||
comments: 评论
|
||||
comment: 评论
|
||||
home: 首页
|
||||
archive: 归档
|
||||
archives: 归档
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<div class="comments-container">
|
||||
<div id="comment-anchor"></div>
|
||||
<% if (theme.comments.valine.enable && theme.comments.gitalk.enable) { %>
|
||||
<% if (theme.comment.valine.enable && theme.comment.gitalk.enable) { %>
|
||||
<%- partial('valine') %>
|
||||
<% } else if (theme.comments.valine.enable) { %>
|
||||
<% } else if (theme.comment.valine.enable) { %>
|
||||
<%- partial('valine') %>
|
||||
<% } else if (theme.comments.gitalk.enable) { %>
|
||||
<% } else if (theme.comment.gitalk.enable) { %>
|
||||
<%- partial('gitalk') %>
|
||||
<% } %>
|
||||
</div>
|
|
@ -0,0 +1,22 @@
|
|||
<% if(
|
||||
theme.comment.gitalk.enable
|
||||
&& theme.comment.gitalk.client_id
|
||||
&& theme.comment.gitalk.client_secret
|
||||
&& theme.comment.gitalk.github_id
|
||||
&& theme.comment.gitalk.repository
|
||||
) { %>
|
||||
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
|
||||
<div id="gitalk-container"></div>
|
||||
<script>
|
||||
const gitalk = new Gitalk({
|
||||
clientID: '<%= theme.comment.gitalk.client_id %>',
|
||||
clientSecret: '<%= theme.comment.gitalk.client_secret %>',
|
||||
repo: '<%= theme.comment.gitalk.repository %>',
|
||||
owner: '<%= theme.comment.gitalk.github_id %>',
|
||||
admin: ['<%= theme.comment.gitalk.github_id %>'],
|
||||
id: location.pathname,
|
||||
language: '<%= config.language %>'
|
||||
})
|
||||
gitalk.render('gitalk-container')
|
||||
</script>
|
||||
<% } %>
|
|
@ -1,7 +1,7 @@
|
|||
<% if(
|
||||
theme.comments.valine.enable
|
||||
&& theme.comments.valine.appid
|
||||
&& theme.comments.valine.appkey
|
||||
theme.comment.valine.enable
|
||||
&& theme.comment.valine.appid
|
||||
&& theme.comment.valine.appkey
|
||||
) { %>
|
||||
<div class="valine-container">
|
||||
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
|
||||
|
@ -9,12 +9,12 @@
|
|||
<script>
|
||||
new Valine({
|
||||
el: '#vcomments',
|
||||
appId: '<%= theme.comments.valine.appid %>',
|
||||
appKey: '<%= theme.comments.valine.appkey %>',
|
||||
meta: '<%= theme.comments.valine.meta %>'.split(','),
|
||||
appId: '<%= theme.comment.valine.appid %>',
|
||||
appKey: '<%= theme.comment.valine.appkey %>',
|
||||
meta: '<%= theme.comment.valine.meta %>'.split(','),
|
||||
avatar: 'wavatar',
|
||||
enableQQ: true,
|
||||
placeholder: '<%= theme.comments.valine.placeholder %>',
|
||||
placeholder: '<%= theme.comment.valine.placeholder %>',
|
||||
lang: '<%= config.language %>'.toLowerCase()
|
||||
});
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<% if(
|
||||
theme.comments.gitalk.enable
|
||||
&& theme.comments.gitalk.client_id
|
||||
&& theme.comments.gitalk.client_secret
|
||||
&& theme.comments.gitalk.github_id
|
||||
&& theme.comments.gitalk.repository
|
||||
) { %>
|
||||
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
|
||||
<div id="gitalk-container"></div>
|
||||
<script>
|
||||
const gitalk = new Gitalk({
|
||||
clientID: '<%= theme.comments.gitalk.client_id %>',
|
||||
clientSecret: '<%= theme.comments.gitalk.client_secret %>',
|
||||
repo: '<%= theme.comments.gitalk.repository %>',
|
||||
owner: '<%= theme.comments.gitalk.github_id %>',
|
||||
admin: ['<%= theme.comments.gitalk.github_id %>'],
|
||||
id: location.pathname,
|
||||
language: '<%= config.language %>'
|
||||
})
|
||||
gitalk.render('gitalk-container')
|
||||
</script>
|
||||
<% } %>
|
|
@ -22,6 +22,6 @@
|
|||
<% } %>
|
||||
|
||||
<% if (theme.toc.enable) { %>
|
||||
<%- js(['lib/anime.min.js', 'js/toc.js']) %>
|
||||
<%- js(['js/libs/anime.min.js', 'js/toc.js']) %>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</li>
|
||||
<% } %>
|
||||
|
||||
<% if (is_post() && (theme.comments.valine.enable || theme.comments.gitalk.enable)) { %>
|
||||
<% if (is_post() && (theme.comment.valine.enable || theme.comment.gitalk.enable)) { %>
|
||||
<li class="go-comment">
|
||||
<i class="fa fa-comment"></i>
|
||||
</li>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
<%- page.content %>
|
||||
</div>
|
||||
<div class="about-comments">
|
||||
<% if (page.comments) { %>
|
||||
<%- partial('_partial/comments/comment') %>
|
||||
<% if (page.comment) { %>
|
||||
<%- partial('_partial/comment/comment') %>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -61,9 +61,9 @@
|
|||
</div>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.comments.valine.enable || theme.comments.gitalk.enable) { %>
|
||||
<% if (theme.comment.valine.enable || theme.comment.gitalk.enable) { %>
|
||||
<div class="comment-container">
|
||||
<%- partial('_partial/comments/comment') %>
|
||||
<%- partial('_partial/comment/comment') %>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
}) %>
|
||||
</div>
|
||||
<div class="category-comments">
|
||||
<% if (page.comments) { %>
|
||||
<%- partial('_partial/comments/comment') %>
|
||||
<% if (page.comment) { %>
|
||||
<%- partial('_partial/comment/comment') %>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
<%- page.content %>
|
||||
</div>
|
||||
<div class="links-comments">
|
||||
<% if (page.comments) { %>
|
||||
<%- partial('_partial/comments/comment') %>
|
||||
<% if (page.comment) { %>
|
||||
<%- partial('_partial/comment/comment') %>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
if (hexo-config('comment.valine.enable')) {
|
||||
@require "./valine.styl";
|
||||
}
|
||||
|
||||
if (hexo-config('comment.gitalk.enable')) {
|
||||
@require "./gitalk.styl";
|
||||
}
|
||||
|
||||
if (hexo-config('comment.valine.enable') && hexo-config('comment.gitalk.enable')) {
|
||||
@require "./valine.styl";
|
||||
}
|
||||
|
||||
.comments-container {
|
||||
#comment-anchor {
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
}
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
if (hexo-config('comments.valine.enable')) {
|
||||
@require "./valine.styl";
|
||||
}
|
||||
|
||||
if (hexo-config('comments.gitalk.enable')) {
|
||||
@require "./gitalk.styl";
|
||||
}
|
||||
|
||||
.comments-container {
|
||||
#comment-anchor {
|
||||
width: 100%;
|
||||
height: 20px;
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
@import "layout/page.styl"
|
||||
@import "layout/_partial/local-search.styl"
|
||||
@import "layout/_partial/toc.styl"
|
||||
@import "layout/_partial/comments/comment.styl"
|
||||
@import "layout/_partial/comment/comment.styl"
|
||||
@import "layout/_partial/header.styl"
|
||||
@import "layout/_partial/tools.styl"
|
||||
@import "layout/_partial/tools2.styl"
|
||||
|
|
Loading…
Reference in New Issue