Merge remote-tracking branch 'origin/master'

# Conflicts:
#	layout/_partial/header.ejs
This commit is contained in:
Benjamin Sproule 2015-07-18 19:37:41 +01:00
commit 235cde8806
7 changed files with 44 additions and 27 deletions

View File

@ -32,11 +32,11 @@ git pull
```r ```r
# Header # Header
menu: menu:
Home: / Home: .
Archives: /archives Archives: archives
Categories: /categories # -> you need to add extra page to enable this, please see the config below. Categories: categories # you need to add extra page to enable this, please see the config below.
Tags: /tags # -> you need to add extra page to enable this, please see the config below. Tags: tags # you need to add extra page to enable this, please see the config below.
About: /about About: about
# Content # Content
excerpt_link: Read More excerpt_link: Read More
@ -58,7 +58,7 @@ contacts:
twitter: '#' twitter: '#'
facebook: '#' facebook: '#'
dribbble: '#' dribbble: '#'
rss: /atom.xml rss: atom.xml
# Links # Links
links: links:
@ -66,7 +66,7 @@ links:
# Miscellaneous # Miscellaneous
google_analytics: google_analytics:
favicon: /favicon.png favicon: favicon.png
twitter: twitter:
google_plus: google_plus:
fb_admins: fb_admins:
@ -107,7 +107,19 @@ disqus_shortname:
- **location** - Where you live in. - **location** - Where you live in.
- **disqus_shortname** - Your Disqus shortname. - **disqus_shortname** - Your Disqus shortname.
## Custom Categories & Tags Pages ### Post Thumbnail & Banner
You can add a thumbnail and a banner to each post by adding the following lines into your post source files' front-matter:
```r
title: Demo
date: 2015-01-01
...
# add those
thumbnail: http://example.com/thumbnail.jpg
banner: http://example.com/banner.jpg
```
### Custom Categories & Tags Pages
To enable custom categories page and tags page, just copy the `categories` folder and `tags` folder under your theme's `_source` foler into your site's `source` folder. Then edit theme's _config.yml and add the following lines: To enable custom categories page and tags page, just copy the `categories` folder and `tags` folder under your theme's `_source` foler into your site's `source` folder. Then edit theme's _config.yml and add the following lines:
```r ```r
@ -119,7 +131,7 @@ menu:
... ...
``` ```
## Languages ### Languages
English and Simplified Chinese are the default languages of the theme. You can add translations in the `languages` folder and change the default language in blog's `_config.yml`. English and Simplified Chinese are the default languages of the theme. You can add translations in the `languages` folder and change the default language in blog's `_config.yml`.

View File

@ -1,10 +1,10 @@
# Header # Header
menu: menu:
Home: / Home: .
Archives: /archives Archives: archives
Categories: /categories Categories: categories
Tags: /tags Tags: tags
About: /about About: about
# Content # Content
excerpt_link: Read More excerpt_link: Read More
@ -29,7 +29,7 @@ contacts:
twitter: '#' twitter: '#'
facebook: '#' facebook: '#'
dribbble: '#' dribbble: '#'
rss: /atom.xml rss: atom.xml
# Links # Links
links: links:
@ -37,8 +37,8 @@ links:
# Miscellaneous # Miscellaneous
google_analytics: google_analytics:
favicon: /favicon.png favicon: favicon.png
twitter: twitter:
google_plus: google_plus:
fb_admins: fb_admins:
fb_app_id: fb_app_id:

View File

@ -13,6 +13,7 @@ location: 'Harbin, China'
follow: https://github.com/ppoffice/ follow: https://github.com/ppoffice/
language: en language: en
timezone: timezone:
since: 2000 # The start year showing in your copyright section.
# URL # URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'

View File

@ -52,4 +52,4 @@
<noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by DuoShuo.</a></noscript> <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by DuoShuo.</a></noscript>
</div> </div>
</section> </section>
<% } %> <% } %>

View File

@ -4,7 +4,7 @@
<% } %> <% } %>
<div class="outer"> <div class="outer">
<div id="footer-info" class="inner"> <div id="footer-info" class="inner">
&copy; <%= date(new Date(), 'YYYY') %> <%= config.author || config.title %><br> &copy; <% if (config.since && config.since != date(new Date(), 'YYYY')){ %><%= config.since %> - <% } %><%= date(new Date(), 'YYYY') %> <%= config.author || config.title %><br>
Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>. Theme by <a href="http://github.com/ppoffice">PPOffice</a> Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>. Theme by <a href="http://github.com/ppoffice">PPOffice</a>
</div> </div>
</div> </div>

View File

@ -1,6 +1,8 @@
<div class="<%= class_name %>"> <% if (post.date && !post.hidedate){ %>
<i class="fa fa-calendar"></i> <div class="<%= class_name %>">
<a href="<%- url_for(post.path) %>"> <i class="fa fa-calendar"></i>
<time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date, date_format) %></time> <a href="<%- url_for(post.path) %>">
</a> <time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date, date_format) %></time>
</div> </a>
</div>
<% } %>

View File

@ -1,14 +1,16 @@
<a href="<%- url_for((post.link?post.link:post.path)) %>" class="thumbnail"> <a href="<%- url_for((post.link?post.link:post.path)) %>" class="thumbnail">
<% <%
var s = ""; var s = "";
if (post.thumbnail){ if (post.thumbnail){
s = post.thumbnail; s = post.thumbnail;
}else if (post.banner){ }else if (post.banner){
s = post.banner; s = post.banner;
}else if (post.photos && post.photos.length){
s = post.photos[0];
}else{ }else{
var img=/\<img\s.*?\s?src\s*=\s*['|"]?([^\s'"]+).*?\>/ig; var img=/\<img\s.*?\s?src\s*=\s*['|"]?([^\s'"]+).*?\>/ig;
var result = post.content.match(img); var result = post.content.match(img);
result = img.exec(post.content); result = img.exec(post.content);
if(result != null) { if(result != null) {
for(var i = result.length -1; i; --i){ for(var i = result.length -1; i; --i){