Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dongyuanxin committed Dec 8, 2018
2 parents aafad68 + e03eeaa commit 11b4f85
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 54 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@

[![](https://img.shields.io/badge/made_with-love-orange.svg)](https://godbmw.com/)
[![](https://img.shields.io/badge/build-passing-green.svg)](https://godbmw.com/)
[![](https://img.shields.io/badge/release-v3.1.0-blue.svg)](https://godbmw.com/)
[![](https://img.shields.io/badge/release-v4.0.1-blue.svg)](https://godbmw.com/)
[![](https://img.shields.io/badge/hexo->=3.0-blue.svg)](https://godbmw.com/)
[![](https://img.shields.io/badge/leancloud-=3.3.1-blue.svg)](https://godbmw.com/)
[![](https://img.shields.io/badge/license-MIT-blue.svg)](https://godbmw.com/)

- 🇨🇳 [中文文档](https://godbmw.com/passages/2018-11-15-theme-bmw-docs-zh/)
- Author: [Godbmw](https://godbmw.com/)

<!-- ## 源码地址
> **如果您看的顺眼,欢迎来第一个地址给个Star**。每个Star都会增加我维护此主题的热情!
- Github: [https://github.com/dongyuanxin/theme-bmw](https://github.com/dongyuanxin/theme-bmw)
- ~~Vuejs版本: https://github.com/dongyuanxin/vuejs-theme-bmw~~ -->

## 在线演示

- 🏠 首页页面: [https://godbmw.com/](https://godbmw.com/)
Expand Down
3 changes: 3 additions & 0 deletions layout/_partial/fancybox.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
}
$(document).ready(function() {
$(".post img").each(function () {
if($(this).parent().get(0).tagName.toLowerCase() === "a") {
return;
}
// $(this).attr("data-fancybox", "gallery"); // if you add 'data-fancybox', img will display after showed
var element = document.createElement("a");
$(element).attr("data-fancybox", "gallery");
Expand Down
16 changes: 10 additions & 6 deletions layout/_partial/timer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,28 @@ const calcAndWriteTimes = () => {
for(let timerDOM of timerAllDOM) {
let identity = timerDOM.getAttribute("data-identity");
timerDOMCache[identity] = {
dom: timerDOM,
times: undefined
};
if(timerDOMCache.hasOwnProperty(identity)){
timerDOMCache[identity].dom.push(timerDOM);
}else{
timerDOMCache[identity] = {
dom: [timerDOM],
times: undefined
};
}
}
let identities = Object.keys(timerDOMCache);
valineAPI._get(identities).then(results => {
for(let result of results) {
let {identity, times} = result.attributes;
timerDOMCache[identity].times = times;
timerDOMCache[identity].dom.innerText = times;
timerDOMCache[identity].dom.map(item => item.innerText = times);
}
for(let identity of identities) {
if(timerDOMCache[identity].times){
continue;
}
timerDOMCache[identity].dom.innerText = 1;
timerDOMCache[identity].dom.map(item => item.innerText = 1);
valineAPI.create(identity);
}
}).catch(error => console.log(error.message))
Expand Down
12 changes: 6 additions & 6 deletions layout/component/passage-viewer.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ const getRealPath = pathname => {
发布 :
<%- page.date.format("YYYY-MM-DD") %>
</span>
<span>
分类 :
<% if(page.categories && page.categories.length > 0) { %>
<% if(page.categories && page.categories.length > 0) { %>
<span>
分类 :
<a href="<%= url_for(page.categories.data[0].path)%>">
<%- page.categories.data[0].name %>
</a>
<% } %>
</span>
</span>
<% } %>
<% if(theme.leancloud.timer){ %>
<span>
浏览 : <span class="article-timer" data-identity="<%- getRealPath(page.path) %>"></span>
Expand Down Expand Up @@ -73,8 +73,8 @@ const getRealPath = pathname => {
<div class="article-footer">
<div class="article-meta pull-left">
<span>
<i class="iconfont icon-06tags"></i>标签:
<% if(page.tags && page.tags.length > 0){ %>
<i class="iconfont icon-06tags"></i>标签:
<% for(let item of page.tags.data){ %>
<span class="span--tag">
<a href="<%= url_for(item.path)%>">
Expand Down
14 changes: 7 additions & 7 deletions layout/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ const getRealPath = pathname => {
<span>
发布 : <%- psg.date.format("YYYY-MM-DD") %>
</span>
<span>
<% if(psg.categories && psg.categories.length > 0) { %>
<span>
分类 :
<% if(psg.categories && psg.categories.length > 0) { %>
<a href="<%= url_for(psg.categories.data[0].path)%>">
<%- psg.categories.data[0].name %>
</a>
<% } %>
</span>
</span>
<% } %>
<% if(theme.leancloud.timer){ %>
<span>
浏览 : <span class="article-timer" data-identity="<%- getRealPath(psg.path) %>"></span>
Expand All @@ -59,16 +59,16 @@ const getRealPath = pathname => {
<div class="article-meta pull-left">
<!-- 分类pc端可见 -->
<span class="pc-view">
<i class="iconfont icon-tag"></i>分类:
<% if(psg.categories && psg.categories.length > 0) { %>
<i class="iconfont icon-tag"></i>分类:
<a href="<%= url_for(psg.categories.data[0].path)%>">
<%- psg.categories.data[0].name %>
</a>
</span>
<% } %>
</span>
<span>
<i class="iconfont icon-06tags"></i>标签:
<% if(psg.tags && psg.tags.length > 0){ %>
<i class="iconfont icon-06tags"></i>标签:
<% for(let item of psg.tags.data){ %>
<span class="span--tag">
<a href="<%= url_for(item.path)%>">
Expand Down
57 changes: 31 additions & 26 deletions source/css/base.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion source/css/base.css.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions source/scss/article.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ $header-level: 6 !default;
}

.article-footer {
margin-top: 3rem;

.article-meta {
font-size: 1.3rem;
color: #9e9e9e;
Expand Down
6 changes: 6 additions & 0 deletions source/scss/layout/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,9 @@
}
}

@media (max-width: 768px) {
.comment-title {
margin-top: 5rem;
}
}

1 comment on commit 11b4f85

@dongyuanxin
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HOTFIX

  1. hide categoires or tag style should be display when one of them is empty
  2. passage's browsing information is lost in mobile phone
  3. img which is wrapped in <a> should not be handled with fancybox-plugin

IMPROVE

  1. passage's footer style

Please sign in to comment.