Skip to content

Commit

Permalink
v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yscoder committed Oct 28, 2016
1 parent 9546580 commit 3445246
Show file tree
Hide file tree
Showing 22 changed files with 287 additions and 54 deletions.
49 changes: 14 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,28 @@
hexo-theme-material-indigo
================

Material Design 风格的Hexo主题,基于 Hexo 3.0+ 制作。预览 [我的博客](http://www.imys.net/)
Material Design 风格的Hexo主题,基于 Hexo 3.0+ 制作。 Preview: [我的博客](http://www.imys.net/)

## 特色
> 现有两个主题分支,我的博客中使用的是 card 分支卡片风格主题,master 分支是旧版平铺式风格主题。
## Feature

1. 仅支持 IE10+ 等现代浏览器。
2. 去 jQuery,更轻。相信现代浏览器的原生兼容性。
3. 去 fancybox。没了 jQuery, 这个自然也失效了。
4. 使用 Less 作为 css 预处理器,需要安装 `hexo-renderer-less`
5. 添加了英文字体支持 Roboto。
6. 添加了一些波纹效果。By [Waves](https://github.com/fians/Waves)
7. 分享直接使用了 JiaThis API 接口,免去了一次加载请求。
8. 基于静态数据的站内搜索,无第三方侵入。
3. 使用 Less 作为 css 预处理器,需要安装 `hexo-renderer-less`
4. 添加了英文字体支持 Roboto。
5. 添加了一些波纹效果。By [Waves](https://github.com/fians/Waves)
6. 分享直接使用了 JiaThis API 接口,免去了一次加载请求。
7. 基于静态数据的站内搜索,无第三方侵入。
8. 内置 Github 风格的多说样式,且集成 Marked.js,支持Markdown评论。
9. 支持文章打赏。

## 使用
## Useage

[文档 | Document](https://github.com/yscoder/hexo-theme-indigo/wiki)

## 更新日志
## ChangeLog

升级前请仔细查看更改内容,如非必要可不升级。

[Log](https://github.com/yscoder/hexo-theme-indigo/wiki/%E6%9B%B4%E6%96%B0%E6%97%A5%E5%BF%97)


## 截图

### PC

![indigo-pc](https://github.com/yscoder/hexo-theme-indigo/raw/master/screenshots/hexo-theme-pc.png)

### Pad

![indigo-pad](https://github.com/yscoder/hexo-theme-indigo/raw/master/screenshots/hexo-theme-pad.png)

### Phone

![indigo-phone](https://github.com/yscoder/hexo-theme-indigo/raw/master/screenshots/hexo-theme-phone.png)

### Search

![indigo-search](https://github.com/yscoder/hexo-theme-indigo/raw/master/screenshots/hexo-theme-search.png)

### Archive

![indigo-archive](https://github.com/yscoder/hexo-theme-indigo/raw/master/screenshots/hexo-theme-archive.png)

[ChangeLog](https://github.com/yscoder/hexo-theme-indigo/releases)
20 changes: 14 additions & 6 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@ rss: /atom.xml

#你的头像url
avatar: /img/logo.jpg
#favicon
favicon: /favicon.ico

# email
email: [email protected]

# 设置 Android L Chrome 浏览器状态栏颜色
color: '#3F51B5'

# Content
tags:
title: 标签
# 页面标题
tags_title: Tags
archives_title: Archives
categories_title: Categories

# 文章截断
excerpt_render: false
Expand Down Expand Up @@ -71,14 +74,14 @@ toc:
list_number: true # 是否显示数字排序

#文章页版权声明内容,hexo中所有变量及辅助函数等均可调用,具体请查阅 hexo.io
copyright: 这里写留言或版权声明:<a href="<%- url_for(page.path) %>" target="_blank" rel="external"><%- url %></a>
copyright: 这里写留言或版权声明:<a href="<%- url_for(page.path).replace(/index\.html$/, '') %>" target="_blank" rel="external"><%- url.replace(/index\.html$/, '') %></a>

#站长统计,如要开启,输入CNZZ站点id,如 cnzz: 1255152447
cnzz: false

# Miscellaneous
google_analytics: ''
favicon: /favicon.ico
google_analytics: false
google_site_verification: false

# less
less:
Expand All @@ -89,3 +92,8 @@ less:
#是否开启多说评论,填写你在多说申请的项目名称 duoshuo: duoshuo-key
#若使用disqus,请在博客config文件中填写disqus_shortname,并关闭多说评论
duoshuo: ysblog
disqus_shortname: false

# 规范网址
# https://support.google.com/webmasters/answer/139066
canonical: http://imys.net
2 changes: 1 addition & 1 deletion layout/_partial/after-footer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var BLOG_SHARE = {
title: "<%-(page.title || config.title) %>",
pic: "<%=theme.avatar %>",
summary: document.getElementsByName('summary')[0].content,
url: "<%=url %>"
url: "<%=url.replace(/index\.html$/, '') %>"
};
</script>
<%- partial('post/share', {className: 'global-share'}) %>
Expand Down
8 changes: 6 additions & 2 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<% if(theme.google_site_verification){ %>
<meta name="google-site-verification" content="<%- theme.google_site_verification%>">
<% }%>
<% if(theme.canonical){ %>
<link rel="canonical" href="<%- (theme.canonical + url_for(page.path)).replace(/index\.html$/, '') %>">
<% }%>
<%
var title = page.title;
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</footer>
</blockquote>

<% if(theme.reward){ %>
<% if(page.reward){ %>
<div class="post-reward">
<a id="rewardBtn" href="javascript:;" class="post-reward-btn waves-effect waves-circle waves-light"></a>
</div>
Expand Down
38 changes: 37 additions & 1 deletion layout/_partial/post/duoshuo.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="duoshuo">
<!-- 多说评论框 start -->
<div class="ds-thread" data-thread-key="<%=key%>" data-title="<%=title%>" data-url="<%=url%>"></div>
<div class="ds-thread" data-thread-key="<%=key%>" data-title="<%=title%>" data-url="<%=url.replace(/index\.html$/, '')%>"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
Expand All @@ -16,3 +16,39 @@
</script>
<!-- 多说公共JS代码 end -->
</div>
<script src="//cdn.bootcss.com/marked/0.3.6/marked.min.js" async="async"></script>
<script>
window.addEventListener('load', function(){
this.addEventListener('click', function(e) {
if(e.target.className === 'ds-post-button') {
postComment(e.target.form)
e.preventDefault()
}
})
function postComment(form) {
var message = form.message.value.trim()
if(!message) {
alert('你还没有输入评论!')
return
}
if(!DUOSHUO.visitor.data.name) {
alert('你还没有登陆!')
return
}
DUOSHUO.API.post('posts/create', {
message: marked(message).replace(/>\n/g, '>'),
thread_id: form.thread_id.value,
parent_id: form.parent_id.value,
nonce: form.nonce.value,
v: DUOSHUO.version
}, function(res){
if(res.code === 0) {
form.message.value = ''
if(form.parentNode.classList.contains('ds-inline-replybox')) {
form.parentNode.previousElementSibling.querySelector('.ds-post-reply').click()
}
}
})
}
})
</script>
2 changes: 1 addition & 1 deletion layout/_partial/post/reward.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if(theme.reward){ %>
<% if(page.reward){ %>
<div id="reward" class="reward-lay">
<a class="reward-off" id="rewardOff" href="javascript:;"><i class="icon icon-close"></i></a>
<h3 class="reward-title">
Expand Down
4 changes: 2 additions & 2 deletions layout/archive.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%- partial('_partial/header', {
title: locals.title || 'Archives',
hdClass: locals.hdClass || 'archives-header'
title: theme.archives_title,
hdClass: 'archives-header'
}) %>
<div class="container body-wrap">
<%
Expand Down
2 changes: 1 addition & 1 deletion layout/categories.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%- partial('_partial/header', {
title: 'Categories',
title: locals.title || theme.categories_title,
hdClass: 'categories-header'
}) %>
<div class="container body-wrap">
Expand Down
2 changes: 1 addition & 1 deletion layout/category.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%- partial('categories', {
pagination: config.archive,
title: 'Categories: '+page.category
title: theme.categories_title + ': '+ _.capitalize(page.category)
}) %>
2 changes: 2 additions & 0 deletions layout/layout.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!DOCTYPE html>
<html>
<%- partial('_partial/head') %>
<body>
<%- partial('_partial/loading') %>
Expand Down
3 changes: 3 additions & 0 deletions layout/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: page.title,
hdClass: 'post-header'
}) %>
<%
page.reward = 'reward' in page ? (theme.reward && page.reward) : theme.reward
%>
<div class="container body-wrap">
<%- partial('_partial/post', {post: page }) %>
</div>
2 changes: 1 addition & 1 deletion layout/tag.ejs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%- partial('tags', {
pagination: config.archive,
title: 'Tags: '+page.tag
title: theme.tags_title + ': '+ _.capitalize(page.tag)
}) %>
2 changes: 1 addition & 1 deletion layout/tags.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%- partial('_partial/header', {
title: locals.title || 'Tags',
title: locals.title || theme.tags_title,
hdClass: 'tags-header'
}) %>
<div class="container body-wrap">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "hexo-theme-material-indigo",
"version": "1.0.3",
"version": "1.1.0",
"private": true
}
Binary file removed screenshots/hexo-theme-archive.png
Binary file not shown.
Binary file removed screenshots/hexo-theme-pad.png
Binary file not shown.
Binary file removed screenshots/hexo-theme-pc.png
Binary file not shown.
Binary file removed screenshots/hexo-theme-phone.png
Binary file not shown.
Binary file removed screenshots/hexo-theme-search.png
Binary file not shown.
Loading

0 comments on commit 3445246

Please sign in to comment.