diff --git a/layout/archive.ejs b/layout/archive.ejs index 7cac829..64e4a15 100644 --- a/layout/archive.ejs +++ b/layout/archive.ejs @@ -1 +1,32 @@ -<%- partial('common/archive', {type: 'archive', index: true}) %> \ No newline at end of file +
+ <% var last; + page.posts.each(function(post, i) { + var year = post.date.year(); + if (last != year) { + last = year; %> +
+ +

<%= year %>

+
+ <% } %> +
+ +
+ <%- partial('common/post/title', { post: post, index: true, class_name: 'timeline-article-title' }) %> + +
+
+ <% }); %> +
+<% if (page.total > 1) { %> + +<% } %> \ No newline at end of file diff --git a/layout/category.ejs b/layout/category.ejs index 26aa213..a57e99c 100644 --- a/layout/category.ejs +++ b/layout/category.ejs @@ -1 +1 @@ -<%- partial('common/archive', {type: 'category', index: true}) %> \ No newline at end of file +<%- partial('common/timeline', { type: 'category' }) %> \ No newline at end of file diff --git a/layout/common/archive.ejs b/layout/common/archive.ejs deleted file mode 100644 index 4d00123..0000000 --- a/layout/common/archive.ejs +++ /dev/null @@ -1,60 +0,0 @@ -<% switch (type) { - case 'archive': - var last; - page.posts.each(function(post, i) { - var year = post.date.year(); - if (last != year) { - if (last != null) { %> - - <% } - last = year; %> -
- <%= year %> -
-
-
- <% } %> - <%- partial('summary', {post: post, archive: true}) %> - <% }); - if (page.posts.length) { %> -
- <% } - break; - case 'category': %> -
-
- <%= page.category %> -
-
- <% page.posts.each(function (post, i) { %> - <%- partial('summary', {post: post, archive: false}) %> - <% }); %> -
- <% - break; - case 'tag': %> -
-
- #<%= page.tag %> -
-
- <% page.posts.each(function (post, i) { %> - <%- partial('summary', {post: post, archive: false}) %> - <% }); %> -
- <% - break; - default: - page.posts.each(function(post) { %> - <%- partial('article', { post: post, index: true }) %> - <% }) - break; -} -if (page.total > 1) { %> - -<% } %> \ No newline at end of file diff --git a/layout/common/article.ejs b/layout/common/article.ejs index 392a159..c12b6a9 100644 --- a/layout/common/article.ejs +++ b/layout/common/article.ejs @@ -15,8 +15,8 @@ <% } %>
- <% if (index) { %> -

<%- excerpt(post) %>

+ <% if (index && post.excerpt) { %> +

<%- post.excerpt %>

<%= __('article.more') %>

diff --git a/layout/common/summary.ejs b/layout/common/summary.ejs deleted file mode 100644 index be38b83..0000000 --- a/layout/common/summary.ejs +++ /dev/null @@ -1,23 +0,0 @@ -
- <% if(theme.customize.thumbnail == true) { %> -
- <%- partial('thumbnail.ejs', { post: post }) %> -
- <% } %> -
-
- <%- partial('post/title', { class_name: 'archive-article-title' }) %> - -
-
-

<%- excerpt(post) %>

-

- <%= __('article.more') %> -

-
-
-
\ No newline at end of file diff --git a/layout/common/timeline.ejs b/layout/common/timeline.ejs new file mode 100644 index 0000000..bafcabe --- /dev/null +++ b/layout/common/timeline.ejs @@ -0,0 +1,39 @@ +<% + switch (type) { + case 'category': + title = page.category; + icon = 'folder'; + break; + case 'tag': + title = '#' + page.tag; + icon = 'tag'; + break; + } +%> +
+
+ +

<%= title %>

+
+ <% page.posts.each(function (post, i) { %> +
+ +
+ <%- partial('post/title', { post: post, index: true, class_name: 'timeline-article-title' }) %> + +
+
+ <% }); %> +
+<% if (page.total > 1) { %> + +<% } %> \ No newline at end of file diff --git a/layout/index.ejs b/layout/index.ejs index b054932..6ac5828 100644 --- a/layout/index.ejs +++ b/layout/index.ejs @@ -1 +1,11 @@ -<%- partial('common/archive', {type: '', index: true}) %> \ No newline at end of file +<% page.posts.each(function(post) { %> + <%- partial('common/article', { post: post, index: true }) %> +<% }); +if (page.total > 1) { %> + +<% } %> \ No newline at end of file diff --git a/layout/tag.ejs b/layout/tag.ejs index 35cb35a..66071c9 100644 --- a/layout/tag.ejs +++ b/layout/tag.ejs @@ -1 +1 @@ -<%- partial('common/archive', {type: 'tag', index: true}) %> \ No newline at end of file +<%- partial('common/timeline', { type: 'tag' }) %> \ No newline at end of file diff --git a/source/css/_partial/timeline.styl b/source/css/_partial/timeline.styl new file mode 100644 index 0000000..4519b2f --- /dev/null +++ b/source/css/_partial/timeline.styl @@ -0,0 +1,60 @@ +.timeline-wrap + border-left: 4px solid #e7e7e7 + margin: 40px 20px 40px 40px + +.timeline-row + clearfix() + margin: 20px 0 + .node, + .title + float: left + .node + width: 12px + color: white + height: 12px + border-radius: 50% + margin: 11px 0 0 -8px + display: inline-block + background-color: #38b7ea + .content + margin-left: 25px + position: relative + background-color: white + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) + &:after, + &:before + content: '' + position: absolute + display: inline-block + &:after + top: 10px + left: -14px + border: 7px solid transparent + border-right-color: white + &:before + top: 9px + left: -16px + border: 8px solid transparent + border-right-color: rgba(0, 0, 0, 0.05) + h1, + .article-meta + padding: 10px + h1 + font-size: 16px + a + @extend $link-dark + .article-meta + border-top: 1px solid #f7f7f7 + background-color: rgba(244, 246, 247, 0.2) + +.timeline-row-major + .node + width: 14px + height: 14px + font-size: 14px + margin: 0 0 0 -17px + padding: 6px 8px 10px + .title + font-size: 18px + margin-left: 15px + line-height: 30px diff --git a/source/css/style.styl b/source/css/style.styl index 0d56be4..1e72f16 100644 --- a/source/css/style.styl +++ b/source/css/style.styl @@ -80,6 +80,7 @@ code @import "_partial/article" @import "_partial/comment" @import "_partial/archive" +@import "_partial/timeline" @import "_partial/footer" @import "_partial/sidebar" @import "_highlight/index"