diff --git a/README.md b/README.md index bb7a4c2..5eedeb1 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,11 @@ git pull ```r # Header menu: - Home: / - Archives: /archives - 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. - About: /about + Home: . + Archives: archives + 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. + About: about # Content excerpt_link: Read More @@ -58,7 +58,7 @@ contacts: twitter: '#' facebook: '#' dribbble: '#' - rss: /atom.xml + rss: atom.xml # Links links: @@ -66,7 +66,7 @@ links: # Miscellaneous google_analytics: -favicon: /favicon.png +favicon: favicon.png twitter: google_plus: fb_admins: @@ -107,7 +107,19 @@ disqus_shortname: - **location** - Where you live in. - **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: ```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`. diff --git a/_config.yml.example b/_config.yml.example index dbe2573..2979a0a 100644 --- a/_config.yml.example +++ b/_config.yml.example @@ -1,10 +1,10 @@ # Header menu: - Home: / - Archives: /archives - Categories: /categories - Tags: /tags - About: /about + Home: . + Archives: archives + Categories: categories + Tags: tags + About: about # Content excerpt_link: Read More @@ -29,7 +29,7 @@ contacts: twitter: '#' facebook: '#' dribbble: '#' - rss: /atom.xml + rss: atom.xml # Links links: @@ -37,8 +37,8 @@ links: # Miscellaneous google_analytics: -favicon: /favicon.png +favicon: favicon.png twitter: google_plus: fb_admins: -fb_app_id: \ No newline at end of file +fb_app_id: diff --git a/_config.yml.site.example b/_config.yml.site.example index 4812df1..0173ed3 100644 --- a/_config.yml.site.example +++ b/_config.yml.site.example @@ -13,6 +13,7 @@ location: 'Harbin, China' follow: https://github.com/ppoffice/ language: en timezone: +since: 2000 # The start year showing in your copyright section. # URL ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' diff --git a/layout/_partial/article.ejs b/layout/_partial/article.ejs index a1470d3..7c8f3d3 100644 --- a/layout/_partial/article.ejs +++ b/layout/_partial/article.ejs @@ -52,4 +52,4 @@ -<% } %> \ No newline at end of file +<% } %> diff --git a/layout/_partial/footer.ejs b/layout/_partial/footer.ejs index a085e36..5b2668e 100644 --- a/layout/_partial/footer.ejs +++ b/layout/_partial/footer.ejs @@ -4,7 +4,7 @@ <% } %>
diff --git a/layout/_partial/post/date.ejs b/layout/_partial/post/date.ejs index e3f5fd8..f0ead26 100644 --- a/layout/_partial/post/date.ejs +++ b/layout/_partial/post/date.ejs @@ -1,6 +1,8 @@ -
- - - - -
\ No newline at end of file +<% if (post.date && !post.hidedate){ %> +
+ + + + +
+<% } %> diff --git a/layout/_partial/post/thumbnail.ejs b/layout/_partial/post/thumbnail.ejs index 8682885..b53b0e4 100644 --- a/layout/_partial/post/thumbnail.ejs +++ b/layout/_partial/post/thumbnail.ejs @@ -1,14 +1,16 @@ <% var s = ""; - + if (post.thumbnail){ s = post.thumbnail; }else if (post.banner){ s = post.banner; + }else if (post.photos && post.photos.length){ + s = post.photos[0]; }else{ var img=/\/ig; - var result = post.content.match(img); + var result = post.content.match(img); result = img.exec(post.content); if(result != null) { for(var i = result.length -1; i; --i){