Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
codefine committed Dec 28, 2017
1 parent 00e6f78 commit 567460f
Show file tree
Hide file tree
Showing 15 changed files with 9,574 additions and 9 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
hexo-theme-mellow
=================
[![](https://img.shields.io/badge/release-v1.2.5-blue.svg?style=flat-square)](https://github.com/codefine/hexo-theme-mellow/releases)
[![](https://img.shields.io/badge/release-v1.2.6-blue.svg?style=flat-square)](https://github.com/codefine/hexo-theme-mellow/releases)
[![](https://img.shields.io/badge/document-CN-green.svg?style=flat-square)](https://github.com/codefine/hexo-theme-mellow/wiki)
[![](https://img.shields.io/badge/preview-Michael.Lu's%20blog-ff69b4.svg?style=flat-square)](https://blog.lujingtao.com)
[![Join the chat at https://gitter.im/hexo-theme-mellow/Lobby](https://badges.gitter.im/hexo-theme-mellow/Lobby.svg)](https://gitter.im/codefine/hexo-theme-mellow?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
Expand All @@ -16,11 +16,12 @@ Material Design 风格的Hexo主题,基于 **Hexo 3.0+** & **Node 7.x+** 制
1. 全端响应式主题。
2. 添加了英文字体支持 bluehost。
3. 添加了一些波纹效果。By [Waves](https://github.com/fians/Waves)
4. 无后端依赖的分享、评论、浏览统计功能实现。
5. 基于静态数据的站内搜索,无第三方侵入。
6. 支持文章打赏。
7. 文章内可引入Github仓库。
8. 持续更新中...
4. 无后端依赖的分享、浏览统计功能实现。
5. 完美集成valine以及gitment评论系统。**【NEW】**
6. 基于静态数据的站内搜索,无第三方侵入。
7. 支持文章打赏。
8. 文章内可引入Github仓库。
9. 持续更新中...

## Document

Expand Down
12 changes: 12 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,18 @@ local_search: true
# 百度统计
baidu_tongji: #appid

# gitment评论系统
## https://github.com/imsun/gitment
gitment:
enable: false
lazy: true #是否开启初始化隐藏评论
owner: codefine #github账号
repo: gitment #留言仓库
oauth:
client_id: #client_id
client_secret: #client_id
perPage: 10 #分页

# valine评论系统
## https://valine.js.org/
valine:
Expand Down
8 changes: 8 additions & 0 deletions layout/_partial/_plugins/gitment.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<% if (theme.gitment.lazy) { %>
<div onclick="ShowGitment()" id="gitment-display-button" style="display: block;">
<span>显示 Gitment 评论</span>
</div>
<div id="gitment" style="display: none;"></div>
<% } else { %>
<div id="gitment"></div>
<% } %>
2 changes: 2 additions & 0 deletions layout/_partial/_third-party/gitment.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<script type="text/javascript" src="<%- url_for(theme_js("/js/plugins/gitmint.browser", cache)) %>"></script>
<script type="text/javascript" src="<%- url_for(theme_js("/js/plugins/gitment", cache)) %>"></script>
6 changes: 5 additions & 1 deletion layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@
<meta name="keywords" content="<%= keyWords %>">
<%- favicon_tag(theme.favicon) %>
<link rel="stylesheet" href="<%- url_for(theme_css('/css/style', cache)) %>">
<% if (!theme.valine.enable && theme.gitment.enable) { %>
<link rel="stylesheet" href="<%- url_for(theme_css('/css/third-party/gitment', cache)) %>">
<% } %>
<script type="text/javascript">
// Data Center
var DC = {
reward: <%- Boolean(page.reward) %>,
lv: JSON.parse('<%- JSON.stringify(theme.leancloud_visitors) %>'),
v: JSON.parse('<%- JSON.stringify(theme.valine) %>')
v: JSON.parse('<%- JSON.stringify(theme.valine) %>'),
g: JSON.parse('<%- JSON.stringify(theme.gitment) %>')
};
</script>
<script type="text/javascript">
Expand Down
14 changes: 14 additions & 0 deletions layout/_partial/post/comment-count.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,17 @@
</a>
</span>
<% } %>

<% if (!theme.valine.enable && theme.gitment.enable) { %>
<span class="post-comments-counter" id="<%- url_for(post.path) %>">
<span class="post-meta-item-icon">
<i class="icon icon-comment-o"></i>
</span>
<%
const link = theme.gitment.lazy ? "gitment-display-button" : "gitment";
%>
<a href="<%- url_for(post.path) %>#<%= link %>">
<span class="post-comments-count gitment-comments-count" itemprop="commentsCount"></span>
</a>
</span>
<% } %>
4 changes: 4 additions & 0 deletions layout/_partial/post/comment.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<% if (theme.valine.enable) { %>
<%- partial('../_plugins/valine') %>
<% } %>

<% if (!theme.valine.enable && theme.gitment.enable) { %>
<%- partial('../_plugins/gitment') %>
<% } %>
3 changes: 3 additions & 0 deletions layout/_partial/script.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
<% if (theme.valine.enable) { %>
<%- partial("_third-party/valine") %>
<% } %>
<% if (!theme.valine.enable && theme.gitment.enable) { %>
<%- partial('_third-party/gitment') %>
<% } %>
<% } %>

<% if (theme.leancloud_visitors.enable) { %>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-mellow",
"version": "1.2.5",
"version": "1.2.6",
"description": "Material Design theme for Hexo.",
"keywords": [
"hexo",
Expand Down
2 changes: 1 addition & 1 deletion source/css/_partial/layout.less
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@

.body-wrap {
padding: 0 0 40px;
min-height: ~'calc(100vh - 340px)';
// min-height: ~'calc(100vh - 340px)';
}

.container {
Expand Down
Loading

0 comments on commit 567460f

Please sign in to comment.