diff --git a/languages/en.yml b/languages/en.yml new file mode 100644 index 0000000..b0d7edb --- /dev/null +++ b/languages/en.yml @@ -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' \ No newline at end of file diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml new file mode 100644 index 0000000..a8cbe65 --- /dev/null +++ b/languages/zh-CN.yml @@ -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: '标签' \ No newline at end of file diff --git a/layout/_partial/header.ejs b/layout/_partial/header.ejs index 291b246..5fb9a79 100644 --- a/layout/_partial/header.ejs +++ b/layout/_partial/header.ejs @@ -2,18 +2,35 @@
-
- <%- search_form({button: ' '}) %> -
+ +
+ <%- search_form({button: ' '}) %> +
+ <% if(page.category || page.archive) { %> -
+
<%- list_categories({depth: 1}) %>
diff --git a/layout/_partial/post/category.ejs b/layout/_partial/post/category.ejs index db2ed48..49e31f8 100644 --- a/layout/_partial/post/category.ejs +++ b/layout/_partial/post/category.ejs @@ -1,10 +1,11 @@ <% if (post.categories && post.categories.length){ %> <% } %> \ No newline at end of file diff --git a/layout/_partial/post/date.ejs b/layout/_partial/post/date.ejs index 3f49613..e3f5fd8 100644 --- a/layout/_partial/post/date.ejs +++ b/layout/_partial/post/date.ejs @@ -1,3 +1,6 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/layout/_partial/profile.ejs b/layout/_partial/profile.ejs index 428ac0d..2ab5dea 100644 --- a/layout/_partial/profile.ejs +++ b/layout/_partial/profile.ejs @@ -5,16 +5,16 @@

<%= config.author %>

<%= config.author_title %>

<%= config.location %> - FOLLOW + <%=__('profile.follow')%>
diff --git a/layout/_widget/archive.ejs b/layout/_widget/archive.ejs index 9a428ba..c76c354 100644 --- a/layout/_widget/archive.ejs +++ b/layout/_widget/archive.ejs @@ -1,6 +1,6 @@ <% if (site.posts.length){ %>
-

Archives

+

<%= __('widget.archives') %>

<%- list_archives() %>
diff --git a/layout/_widget/category.ejs b/layout/_widget/category.ejs index 7836a27..2f5a1a2 100644 --- a/layout/_widget/category.ejs +++ b/layout/_widget/category.ejs @@ -1,6 +1,6 @@ <% if (site.categories.length){ %>
-

Categories

+

<%= __('widget.categories') %>

<%- list_categories() %>
diff --git a/layout/_widget/recent_posts.ejs b/layout/_widget/recent_posts.ejs index f065b0e..e89e845 100644 --- a/layout/_widget/recent_posts.ejs +++ b/layout/_widget/recent_posts.ejs @@ -1,6 +1,6 @@ <% if (site.posts.length){ %>
-

<%= __('sidebar.recents') %>

+

<%= __('widget.recents') %>

    <% site.posts.sort('date', -1).limit(5).each(function(post){ %> @@ -9,7 +9,7 @@ <%- partial('../_partial/post/thumbnail.ejs', {post: post}) %>
-

<%- list_categories(post.categories, {show_count: false, depth:2, class: 'article-category', style: 'none', separator: ''}) %>

+

<%- list_categories(post.categories, {show_count: false, depth:2, class: 'article-category', style: 'none', separator: ''}) %>

<%= post.title %>

diff --git a/layout/_widget/tag.ejs b/layout/_widget/tag.ejs index c163c41..48eface 100644 --- a/layout/_widget/tag.ejs +++ b/layout/_widget/tag.ejs @@ -1,6 +1,6 @@ <% if (site.tags.length){ %>
-

Tags

+

<%= __('widget.tags') %>

<%- list_tags() %>
diff --git a/layout/_widget/tagcloud.ejs b/layout/_widget/tagcloud.ejs index 4b82283..4b01a63 100644 --- a/layout/_widget/tagcloud.ejs +++ b/layout/_widget/tagcloud.ejs @@ -1,6 +1,6 @@ <% if (site.tags.length){ %>
-

Tag Cloud

+

<%= __('widget.tag_cloud') %>

<%- tagcloud() %>
diff --git a/source/css/_extend.styl b/source/css/_extend.styl index 8e6325b..1891ffd 100644 --- a/source/css/_extend.styl +++ b/source/css/_extend.styl @@ -2,10 +2,7 @@ $block-caption text-decoration: none text-transform: uppercase color: color-grey - margin-bottom: 1em line-height: 1em - text-shadow: 0 1px #fff - font-weight: bold $block background: #fff diff --git a/source/css/_partial/article.styl b/source/css/_partial/article.styl index d8b770d..968ba3a 100644 --- a/source/css/_partial/article.styl +++ b/source/css/_partial/article.styl @@ -7,6 +7,13 @@ .article-meta clearfix() + .article-date, .article-category + margin-right: 10px + color: color-default + a + color: color-default + &:hover + color: color-link .article-date @extend $block-caption @@ -15,16 +22,16 @@ .article-category float: left line-height: 1em - color: #ccc - text-shadow: 0 1px #fff - &:before - content: "\2022" + color: color-default .article-category-link @extend $block-caption .article-header padding: article-padding article-padding 0 + .article-title + display: block + margin-bottom: 14px .article-title text-decoration: none @@ -32,6 +39,8 @@ color: color-default line-height: line-height-title transition: color 0.2s + a&:visited + color: color-default a&:hover color: color-link diff --git a/source/css/_partial/header.styl b/source/css/_partial/header.styl index 852d41c..3338d1f 100644 --- a/source/css/_partial/header.styl +++ b/source/css/_partial/header.styl @@ -15,11 +15,9 @@ $header-block $header-block-left float: left - border-right: 1px solid color-border $header-block-right float: right - border-left: 1px solid color-border .header-inner height: 100% @@ -47,9 +45,10 @@ $header-block-right left: 0 margin-top: logo-size * -0.5 -#header-sub +.header-sub border-top: 1px solid color-border ul + clearfix() margin: 0 15px li float: left @@ -57,10 +56,55 @@ $header-block-right a display: inline-block 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 @extend $header-block @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 float: left @@ -81,23 +125,32 @@ $nav-link .main-nav-link @extend $nav-link font-weight: 300 - @media mq-mobile - display: none - -#main-nav-toggle - display: none - &:before - content: "\f0c9" - @media mq-mobile - display: block #sub-nav + @media mq-normal + display: none @extend $header-block @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 + @media mq-mini + display: none @extend $header-block - @extend $header-block-left + @extend $header-block-right width: 200px .search-form position: relative @@ -109,7 +162,7 @@ $nav-link background: none color: color-default width: 100% - font: 13px font-sans + font: font-size font-sans outline: none &::-webkit-search-results-decoration &::-webkit-search-cancel-button diff --git a/source/css/_partial/profile.styl b/source/css/_partial/profile.styl index f2c8831..be99fec 100644 --- a/source/css/_partial/profile.styl +++ b/source/css/_partial/profile.styl @@ -5,7 +5,9 @@ border-bottom: none #profile + display: none @media mq-normal + display: block column(profile-column) .inner @extend $block diff --git a/source/css/_partial/sidebar.styl b/source/css/_partial/sidebar.styl index 3c182cb..b20d400 100644 --- a/source/css/_partial/sidebar.styl +++ b/source/css/_partial/sidebar.styl @@ -1,6 +1,8 @@ #sidebar @media mq-normal column(sidebar-column) + @media mq-tablet + column(sidebar-column-tablet) .widget @extend $base-style @@ -34,6 +36,8 @@ .widget-wrap margin: block-margin 10px + @media mq-mini + margin: block-margin 20px .widget-title @extend $block-caption @@ -112,7 +116,7 @@ color: color-link &:hover color: color-sidebar-text-dark - a, .icon + a, .fa margin-right: 5px .item-title font-size: 15px diff --git a/source/css/_variables.styl b/source/css/_variables.styl index ba111dc..0e044fb 100644 --- a/source/css/_variables.styl +++ b/source/css/_variables.styl @@ -19,7 +19,7 @@ color-pinterest = #cb2027 color-google = #dd4b39 // 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-mono = "Source Code Pro", Consolas, Monaco, Menlo, Consolas, monospace font-size = 14px @@ -43,9 +43,11 @@ profile-avatar-size = 128px block-margin = 40px article-padding = 20px mobile-nav-width = 280px -main-column = 7 profile-column = 3 sidebar-column = 3 +sidebar-column-tablet = 4 +main-column = 7 +main-column-tablet = 9 if sidebar and sidebar isnt bottom _sidebar-column = sidebar-column @@ -58,6 +60,7 @@ gutter-width = 20px columns = main-column + _sidebar-column + profile-column // Media queries -mq-mobile = "screen and (max-width: 479px)" -mq-tablet = "screen and (min-width: 480px) and (max-width: 767px)" -mq-normal = "screen and (min-width: 768px)" \ No newline at end of file +mq-mini = "screen and (max-width: 559px)" +mq-mobile = "screen and (min-width: 560px) and (max-width: 799px)" +mq-tablet = "screen and (min-width: 800px) and (max-width: 1199px)" +mq-normal = "screen and (min-width: 1200px)" \ No newline at end of file diff --git a/source/css/images/avatar.png b/source/css/images/avatar.png index f5121d9..baba51e 100644 Binary files a/source/css/images/avatar.png and b/source/css/images/avatar.png differ diff --git a/source/css/style.styl b/source/css/style.styl index 03471de..8cb1d27 100644 --- a/source/css/style.styl +++ b/source/css/style.styl @@ -32,6 +32,9 @@ a max-width: (column-width + gutter-width) * columns + gutter-width margin: 0 auto padding: 0 gutter-width + @media mq-mini + padding: 0 + .inner column(columns) @@ -58,6 +61,8 @@ if sidebar and sidebar isnt bottom #main @media mq-normal column(main-column) + @media mq-tablet + column(main-column-tablet) @import "_extend" @import "_partial/header"