Skip to content

Commit

Permalink
css cdn & add brand config, v1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yscoder committed Mar 31, 2017
1 parent 9d1a6d5 commit 9cd432a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ rss: /atom.xml

# 你的头像url
avatar: /img/avatar.jpg
# 头像背景图
brand: /img/brand.jpg
# favicon
favicon: /favicon.ico

Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
<link rel="alternative" href="<%- theme.rss %>" title="<%= config.title %>" type="application/atom+xml">
<% } %>
<%- favicon_tag(theme.favicon) %>
<link rel="stylesheet" href="<%= url_for('/css/style.css?v='+ theme_version()) %>">
<link rel="stylesheet" href="<%- url_for(theme_css('/css/style', cache)) %>">
<script>window.lazyScripts=[]</script>
</head>
2 changes: 1 addition & 1 deletion layout/_partial/menu.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
<i class="icon icon-lg icon-close"></i>
</a>
<div class="brand-wrap">
<div class="brand-wrap" style="background-image:url(<%- url_for(theme.brand) %>)">
<div class="brand">
<a href="<%- config.root %>" class="avatar waves-effect waves-circle waves-light">
<img src="<%- url_for(theme.avatar) %>">
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-material-indigo",
"version": "1.5.0",
"version": "1.5.2",
"description": "Material Design theme for Hexo.",
"keywords": [
"hexo",
Expand Down
4 changes: 2 additions & 2 deletions scripts/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ hexo.extend.helper.register('theme_version', () => version)

const source = (path, cache, ext) => {
if(cache) {
const minFile = `${path}.min${ext}`
return hexo.theme.config.cdn ? `//unpkg.com/${name}@${version}/source${minFile}` : `${minFile}?v=${version}`
const minFile = `${path}${ext === '.js' ? '.min' : ''}${ext}`
return hexo.theme.config.cdn ? `//unpkg.com/${name}@${version}${minFile}` : `${minFile}?v=${version}`
} else {
return path + ext
}
Expand Down
1 change: 0 additions & 1 deletion source/css/_partial/layout.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
}

.brand-wrap {
background: url(../img/brand.jpg);
background-size: 100% 100%;
}

Expand Down

0 comments on commit 9cd432a

Please sign in to comment.