Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 9 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
hexo-theme-material-indigo
================

[![Join the chat at https://gitter.im/hexo-theme-indigo/Lobby](https://badges.gitter.im/hexo-theme-indigo/Lobby.svg)](https://gitter.im/hexo-theme-indigo/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

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

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

## Feature

1. 仅支持 IE10+ 等现代浏览器。
2. 去 jQuery,更轻。相信现代浏览器的原生兼容性。
3. 使用 Less 作为 css 预处理器,需要安装 `hexo-renderer-less`。
4. 添加了英文字体支持 Roboto。
5. 添加了一些波纹效果。By [Waves](https://github.com/fians/Waves)
6. 无前端依赖的分享实现。
7. 基于静态数据的站内搜索,无第三方侵入。
8. 支持文章打赏。

## Useage

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

## ChangeLog

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

[ChangeLog](https://github.com/yscoder/hexo-theme-indigo/releases)

## OtherVersion

* [vuepress-theme-indigo](https://github.com/yscoder/vuepress-theme-indigo)
因[原仓库](https://github.com/yscoder/hexo-theme-indigo)停止维护,所以 fork 了一份继续维护配合最新版 hexo

# 分支说明
## hexo6
配合 hexo6 版本的版本
## scar
按照个人喜好改动的版本,也会修复一些 bug,不同如下:
* fix: 分类下的文章没有按时间排序
* refator:点击分类菜单不会改变分类顺序
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ title_change:

# 设置为 true 发布后将使用 unpkg cdn 最新的主题样式
# 如果想让你的自定义样式生效,把此项设为 false
cdn: true
cdn: false

# 设置为 true 将使用 lightbox render 图片
lightbox: true
Expand Down
3 changes: 1 addition & 2 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
var keyWords = config.keywords;
if(page.tags){
keyWords = [];

_.isArray(page.tags) ? ( keyWords = page.tags )
Array.isArray(page.tags) ? ( keyWords = page.tags )
: page.tags.each(function(k){
keyWords.push(k.name);
});
Expand Down
12 changes: 10 additions & 2 deletions layout/_partial/menu.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,23 @@
<%
var menuItem, isActive = function(item) {
var pageUrl = url_for(page.path)
return item.url === '/' ? pageUrl === url_for(item.url + 'index.html') : _.startsWith(pageUrl, url_for(item.url))
return item.url === '/' ? pageUrl === url_for(item.url + 'index.html') : pageUrl.startsWith( url_for(item.url))
};
function startCase(str) {
return str.replace(
/\w\S*/g,
function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
}
);
}
for (var i in theme.menu) {
menuItem = theme.menu[i];
%>
<li class="waves-block waves-effect<% if(isActive(menuItem)){ %> active<% } %>">
<a href="<%- url_for(menuItem.url) %>" <% if(menuItem.target){ %>target="_blank"<% } %> >
<i class="icon icon-lg icon-<%= i %>"></i>
<%=(menuItem.text || _.startCase(i)) %>
<%=(menuItem.text || startCase(i)) %>
</a>
</li>
<% } %>
Expand Down
4 changes: 2 additions & 2 deletions layout/_partial/post/copyright.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<% if(theme.postMessage || theme.show_last_updated) { %>
<div class="content">
<%- partial('updated') %>
<% if(theme.postMessage) {%>
<%- _.template(theme.postMessage)(locals) %>
<% if(theme.postMessage) { const templateLiteral = (value) => theme.postMessage;%>
<%- templateLiteral(locals) %>
<% } %>
</div>
<% } %>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/tags-bar.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(type === 'categories' || type === 'tags'){ %>
}
})

var index = _.findIndex(options, function(o) {
var index = options.findIndex(function(o) {
return is_current(o.path)
})
var len = options.length
Expand Down
7 changes: 4 additions & 3 deletions layout/archive.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
<div class="container body-wrap fade">
<%
var posts = [];

const sortBy = (key) => {
return (a, b) => (a[key] < b[key]) ? 1 : ((b[key] < a[key]) ? -1 : 0);
};
page.posts.each(function(post){
posts.push(post);
});

var sortPosts = _[_.orderBy ? 'orderBy' : 'sortByOrder'](posts, ['date'], ['desc']);
var sortPosts = posts.concat().sort(sortBy("date"));
%>

<%
Expand Down
3 changes: 2 additions & 1 deletion scripts/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ hexo.extend.helper.register('theme_version', () => version)

const source = (path, cache, ext) => {
if (cache) {
const minFile = `${path}${ext === '.js' ? '.min' : ''}${ext}`
// const minFile = `${path}${ext === '.js' ? '.min' : ''}${ext}`
const minFile = `${path}${ext}`
return hexo.theme.config.cdn ? `//unpkg.com/${name}@latest${minFile}` : `${minFile}?v=${version}`
} else {
return path + ext
Expand Down
Loading