pull/1/head
ppoffice 2015-03-20 10:25:44 +08:00
parent b0d3d3fe90
commit c64d3a6fb5
19 changed files with 194 additions and 44 deletions

28
languages/en.yml Normal file
View File

@ -0,0 +1,28 @@
index:
home: 'home'
search: 'Search'
archive: 'archive'
category: 'category'
uncategorized: 'uncategorized'
tag: 'tag'
nav:
current_page:
other: 'Page %d '
total_page:
other: 'of %d'
widget:
recents: 'recents'
archives: 'archives'
categories: 'categories'
links: 'links'
tags: 'tags'
tag_cloud: 'tag cloud'
article:
comments: 'Comments'
share: 'Share'
profile:
follow: 'FOLLOW'
post: 'post'
tag: 'tag'
posts: 'posts'
tags: 'tags'

28
languages/zh-CN.yml Normal file
View File

@ -0,0 +1,28 @@
index:
home: '主页'
search: '搜索'
archive: '归档'
category: '分类'
uncategorized: '未分类'
tag: '标签'
nav:
current_page:
other: '第 %d 页,'
total_page:
other: '共 %d 页'
widget:
recents: '最新文章'
archives: '归档'
categories: '分类'
links: '链接'
tags: '标签'
tag_cloud: '标签云'
article:
comments: '评论'
share: '分享到'
profile:
follow: '关注我'
post: '文章'
tag: '标签'
posts: '文章'
tags: '标签'

View File

@ -2,18 +2,35 @@
<div id="header-main" class="header-inner"> <div id="header-main" class="header-inner">
<div class="outer"> <div class="outer">
<a href="<%- url_for() %>" id="logo"><i class="logo"></i><span class="site-title"><%= config.title %></span></a> <a href="<%- url_for() %>" id="logo"><i class="logo"></i><span class="site-title"><%= config.title %></span></a>
<div id="search-form-wrap">
<%- search_form({button: ' '}) %>
</div>
<nav id="main-nav"> <nav id="main-nav">
<% for (var i in theme.menu){ %> <% for (var i in theme.menu){ %>
<a class="main-nav-link" href="<%- url_for(theme.menu[i]) %>"><%= i %></a> <a class="main-nav-link" href="<%- url_for(theme.menu[i]) %>"><%= i %></a>
<% } %> <% } %>
</nav> </nav>
<nav id="sub-nav">
<div class="profile" id="profile-nav">
<a id="profile-anchor" href="#"><img class="avatar" src="<%- url_for(config.avatar) %>"><i class="fa fa-caret-down"></i></a>
</div> </div>
</nav>
<div id="search-form-wrap">
<%- search_form({button: ' '}) %>
</div>
</div>
</div>
<div id="main-nav-mobile" class="header-sub header-inner">
<table class="menu outer">
<tr>
<% for (var i in theme.menu){ %>
<td><a class="main-nav-link" href="<%- url_for(theme.menu[i]) %>"><%= i %></a></td>
<% } %>
<td>
<%- search_form() %>
</td>
</tr>
</table>
</div> </div>
<% if(page.category || page.archive) { %> <% if(page.category || page.archive) { %>
<div id="header-sub" class="header-inner"> <div id="header-sub" class="header-sub header-inner">
<div class="outer"> <div class="outer">
<%- list_categories({depth: 1}) %> <%- list_categories({depth: 1}) %>
</div> </div>

View File

@ -1,10 +1,11 @@
<% if (post.categories && post.categories.length){ %> <% if (post.categories && post.categories.length){ %>
<div class="article-category"> <div class="article-category">
<i class="fa fa-folder"></i>
<%- list_categories(post.categories, { <%- list_categories(post.categories, {
show_count: false, show_count: false,
class: 'article-category', class: 'article-category',
style: 'none', style: 'none',
separator: '' separator: '<i class="fa fa-angle-right"></i>'
}) %> }) %>
</div> </div>
<% } %> <% } %>

View File

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

View File

@ -5,16 +5,16 @@
<h2 id="name"><%= config.author %></h2> <h2 id="name"><%= config.author %></h2>
<h3 id="title"><%= config.author_title %></h3> <h3 id="title"><%= config.author_title %></h3>
<span id="location"><i class="fa fa-map-marker"></i><%= config.location %></span> <span id="location"><i class="fa fa-map-marker"></i><%= config.location %></span>
<a id="follow" href="http://github.com/ppoffice">FOLLOW</a> <a id="follow" href="http://github.com/ppoffice"><%=__('profile.follow')%></a>
</div> </div>
<div class="article-info profile-block"> <div class="article-info profile-block">
<div class="article-info-block"> <div class="article-info-block">
<%= site.posts.length %> <%= site.posts.length %>
<span>post<%= (site.posts.length > 1?'s':'') %></span> <span><%= (site.posts.length > 1?__('profile.posts'):__('profile.post')) %></span>
</div> </div>
<div class="article-info-block"> <div class="article-info-block">
<%= site.tags.length %> <%= site.tags.length %>
<span>tag<%= (site.tags.length > 1?'s':'') %></span> <span><%= (site.tags.length > 1?__('profile.tags'):__('profile.tag')) %></span>
</div> </div>
</div> </div>
<div class="contact-info profile-block"> <div class="contact-info profile-block">

View File

@ -1,6 +1,6 @@
<% if (site.posts.length){ %> <% if (site.posts.length){ %>
<div class="widget-wrap"> <div class="widget-wrap">
<h3 class="widget-title">Archives</h3> <h3 class="widget-title"><%= __('widget.archives') %></h3>
<div class="widget"> <div class="widget">
<%- list_archives() %> <%- list_archives() %>
</div> </div>

View File

@ -1,6 +1,6 @@
<% if (site.categories.length){ %> <% if (site.categories.length){ %>
<div class="widget-wrap"> <div class="widget-wrap">
<h3 class="widget-title">Categories</h3> <h3 class="widget-title"><%= __('widget.categories') %></h3>
<div class="widget"> <div class="widget">
<%- list_categories() %> <%- list_categories() %>
</div> </div>

View File

@ -1,6 +1,6 @@
<% if (site.posts.length){ %> <% if (site.posts.length){ %>
<div class="widget-wrap"> <div class="widget-wrap">
<h3 class="widget-title"><%= __('sidebar.recents') %></h3> <h3 class="widget-title"><%= __('widget.recents') %></h3>
<div class="widget"> <div class="widget">
<ul id="recent-post"> <ul id="recent-post">
<% site.posts.sort('date', -1).limit(5).each(function(post){ %> <% site.posts.sort('date', -1).limit(5).each(function(post){ %>
@ -9,7 +9,7 @@
<%- partial('../_partial/post/thumbnail.ejs', {post: post}) %> <%- partial('../_partial/post/thumbnail.ejs', {post: post}) %>
</div> </div>
<div class="item-inner"> <div class="item-inner">
<p class="item-category"><%- list_categories(post.categories, {show_count: false, depth:2, class: 'article-category', style: 'none', separator: '<i class="icon" id="icon-angle-right"></i>'}) %></p> <p class="item-category"><%- list_categories(post.categories, {show_count: false, depth:2, class: 'article-category', style: 'none', separator: '<i class="fa fa-angle-right"></i>'}) %></p>
<p class="item-title"><a href="<%- url_for((post.link?post.link:post.path)) %>" class="title"><%= post.title %></a></p> <p class="item-title"><a href="<%- url_for((post.link?post.link:post.path)) %>" class="title"><%= post.title %></a></p>
<p class="item-date"><time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date) %></time></p> <p class="item-date"><time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date) %></time></p>
</div> </div>

View File

@ -1,6 +1,6 @@
<% if (site.tags.length){ %> <% if (site.tags.length){ %>
<div class="widget-wrap"> <div class="widget-wrap">
<h3 class="widget-title">Tags</h3> <h3 class="widget-title"><%= __('widget.tags') %></h3>
<div class="widget"> <div class="widget">
<%- list_tags() %> <%- list_tags() %>
</div> </div>

View File

@ -1,6 +1,6 @@
<% if (site.tags.length){ %> <% if (site.tags.length){ %>
<div class="widget-wrap"> <div class="widget-wrap">
<h3 class="widget-title">Tag Cloud</h3> <h3 class="widget-title"><%= __('widget.tag_cloud') %></h3>
<div class="widget tagcloud"> <div class="widget tagcloud">
<%- tagcloud() %> <%- tagcloud() %>
</div> </div>

View File

@ -2,10 +2,7 @@ $block-caption
text-decoration: none text-decoration: none
text-transform: uppercase text-transform: uppercase
color: color-grey color: color-grey
margin-bottom: 1em
line-height: 1em line-height: 1em
text-shadow: 0 1px #fff
font-weight: bold
$block $block
background: #fff background: #fff

View File

@ -7,6 +7,13 @@
.article-meta .article-meta
clearfix() clearfix()
.article-date, .article-category
margin-right: 10px
color: color-default
a
color: color-default
&:hover
color: color-link
.article-date .article-date
@extend $block-caption @extend $block-caption
@ -15,16 +22,16 @@
.article-category .article-category
float: left float: left
line-height: 1em line-height: 1em
color: #ccc color: color-default
text-shadow: 0 1px #fff
&:before
content: "\2022"
.article-category-link .article-category-link
@extend $block-caption @extend $block-caption
.article-header .article-header
padding: article-padding article-padding 0 padding: article-padding article-padding 0
.article-title
display: block
margin-bottom: 14px
.article-title .article-title
text-decoration: none text-decoration: none
@ -32,6 +39,8 @@
color: color-default color: color-default
line-height: line-height-title line-height: line-height-title
transition: color 0.2s transition: color 0.2s
a&:visited
color: color-default
a&:hover a&:hover
color: color-link color: color-link

View File

@ -15,11 +15,9 @@ $header-block
$header-block-left $header-block-left
float: left float: left
border-right: 1px solid color-border
$header-block-right $header-block-right
float: right float: right
border-left: 1px solid color-border
.header-inner .header-inner
height: 100% height: 100%
@ -47,9 +45,10 @@ $header-block-right
left: 0 left: 0
margin-top: logo-size * -0.5 margin-top: logo-size * -0.5
#header-sub .header-sub
border-top: 1px solid color-border border-top: 1px solid color-border
ul ul
clearfix()
margin: 0 15px margin: 0 15px
li li
float: left float: left
@ -57,10 +56,55 @@ $header-block-right
a a
display: inline-block display: inline-block
line-height: header-sub-height line-height: header-sub-height
.main-nav-link
display: inline-block
line-height: header-sub-height
#header-sub
@media mq-mobile
display: none
@media mq-mini
display: none
#main-nav-mobile
overflow-y: hidden
overflow-x: auto
.menu
clearfix()
margin: 0
height: header-sub-height
.search-form-input
display: none
@media mq-mini
display: block
border: none
outline: none
padding: 0 10px
background: none
margin-right: 15px
color: color-default
font: font-size font-sans
border: 1px solid color-border
line-height: header-sub-height - 16
border-radius: ((header-sub-height - 16)/2)
&::-webkit-search-results-decoration
&::-webkit-search-cancel-button
-webkit-appearance: none
#main-nav #main-nav
@extend $header-block @extend $header-block
@extend $header-block-left @extend $header-block-left
@media mq-mobile
display: none
@media mq-mini
display: none
#main-nav-mobile
@media mq-tablet
display: none
@media mq-normal
display: none
$nav-link $nav-link
float: left float: left
@ -81,23 +125,32 @@ $nav-link
.main-nav-link .main-nav-link
@extend $nav-link @extend $nav-link
font-weight: 300 font-weight: 300
@media mq-mobile
display: none
#main-nav-toggle
display: none
&:before
content: "\f0c9"
@media mq-mobile
display: block
#sub-nav #sub-nav
@media mq-normal
display: none
@extend $header-block @extend $header-block
@extend $header-block-right @extend $header-block-right
#profile-nav
#profile-anchor
clearfix()
display: block
height: logo-size
line-height: logo-size
.avatar, .fa
float: left
.avatar
width: logo-size
height: logo-size
margin-right: 8px
.fa
line-height: logo-size
#search-form-wrap #search-form-wrap
@media mq-mini
display: none
@extend $header-block @extend $header-block
@extend $header-block-left @extend $header-block-right
width: 200px width: 200px
.search-form .search-form
position: relative position: relative
@ -109,7 +162,7 @@ $nav-link
background: none background: none
color: color-default color: color-default
width: 100% width: 100%
font: 13px font-sans font: font-size font-sans
outline: none outline: none
&::-webkit-search-results-decoration &::-webkit-search-results-decoration
&::-webkit-search-cancel-button &::-webkit-search-cancel-button

View File

@ -5,7 +5,9 @@
border-bottom: none border-bottom: none
#profile #profile
display: none
@media mq-normal @media mq-normal
display: block
column(profile-column) column(profile-column)
.inner .inner
@extend $block @extend $block

View File

@ -1,6 +1,8 @@
#sidebar #sidebar
@media mq-normal @media mq-normal
column(sidebar-column) column(sidebar-column)
@media mq-tablet
column(sidebar-column-tablet)
.widget .widget
@extend $base-style @extend $base-style
@ -34,6 +36,8 @@
.widget-wrap .widget-wrap
margin: block-margin 10px margin: block-margin 10px
@media mq-mini
margin: block-margin 20px
.widget-title .widget-title
@extend $block-caption @extend $block-caption
@ -112,7 +116,7 @@
color: color-link color: color-link
&:hover &:hover
color: color-sidebar-text-dark color: color-sidebar-text-dark
a, .icon a, .fa
margin-right: 5px margin-right: 5px
.item-title .item-title
font-size: 15px font-size: 15px

View File

@ -19,7 +19,7 @@ color-pinterest = #cb2027
color-google = #dd4b39 color-google = #dd4b39
// Fonts // Fonts
font-sans = "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif font-sans = "open sans", "Helvetica Neue", "Microsoft Yahei", Helvetica, Arial, sans-serif
font-serif = Georgia, "Times New Roman", serif font-serif = Georgia, "Times New Roman", serif
font-mono = "Source Code Pro", Consolas, Monaco, Menlo, Consolas, monospace font-mono = "Source Code Pro", Consolas, Monaco, Menlo, Consolas, monospace
font-size = 14px font-size = 14px
@ -43,9 +43,11 @@ profile-avatar-size = 128px
block-margin = 40px block-margin = 40px
article-padding = 20px article-padding = 20px
mobile-nav-width = 280px mobile-nav-width = 280px
main-column = 7
profile-column = 3 profile-column = 3
sidebar-column = 3 sidebar-column = 3
sidebar-column-tablet = 4
main-column = 7
main-column-tablet = 9
if sidebar and sidebar isnt bottom if sidebar and sidebar isnt bottom
_sidebar-column = sidebar-column _sidebar-column = sidebar-column
@ -58,6 +60,7 @@ gutter-width = 20px
columns = main-column + _sidebar-column + profile-column columns = main-column + _sidebar-column + profile-column
// Media queries // Media queries
mq-mobile = "screen and (max-width: 479px)" mq-mini = "screen and (max-width: 559px)"
mq-tablet = "screen and (min-width: 480px) and (max-width: 767px)" mq-mobile = "screen and (min-width: 560px) and (max-width: 799px)"
mq-normal = "screen and (min-width: 768px)" mq-tablet = "screen and (min-width: 800px) and (max-width: 1199px)"
mq-normal = "screen and (min-width: 1200px)"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -32,6 +32,9 @@ a
max-width: (column-width + gutter-width) * columns + gutter-width max-width: (column-width + gutter-width) * columns + gutter-width
margin: 0 auto margin: 0 auto
padding: 0 gutter-width padding: 0 gutter-width
@media mq-mini
padding: 0
.inner .inner
column(columns) column(columns)
@ -58,6 +61,8 @@ if sidebar and sidebar isnt bottom
#main #main
@media mq-normal @media mq-normal
column(main-column) column(main-column)
@media mq-tablet
column(main-column-tablet)
@import "_extend" @import "_extend"
@import "_partial/header" @import "_partial/header"