From caeed23e766705eecae7ef17a534213c0f87fdd6 Mon Sep 17 00:00:00 2001 From: SkyArrow Date: Wed, 25 Jan 2012 01:19:10 +0800 Subject: archive, category --- sass/_parts.scss | 1 + sass/parts/_archive.scss | 65 +++++++++++++++++++++++++++++++++++++ sass/parts/_article.scss | 27 --------------- sass/parts/_post.scss | 27 +++++++++++++++ source/_includes/archive_post.html | 15 +++++---- source/_layouts/category_index.html | 23 +++++++------ source/blog/archives/index.html | 27 ++++++++------- 7 files changed, 125 insertions(+), 60 deletions(-) create mode 100644 sass/parts/_archive.scss diff --git a/sass/_parts.scss b/sass/_parts.scss index 72df504..4e6c6ae 100644 --- a/sass/_parts.scss +++ b/sass/_parts.scss @@ -3,6 +3,7 @@ @import "parts/article"; @import "parts/post"; @import "parts/page"; +@import "parts/archive"; @import "parts/comment"; @import "parts/footer"; @import "parts/syntax"; diff --git a/sass/parts/_archive.scss b/sass/parts/_archive.scss new file mode 100644 index 0000000..ad96dc2 --- /dev/null +++ b/sass/parts/_archive.scss @@ -0,0 +1,65 @@ +section.archive{ + position: relative; + &:first-of-type{ + border-top: 1px solid $light-shadow; + article.archive{ + border-top: none; + } + h1.archive-title{ + border-top: none; + &:before{ + border-top: none; + } + } + } + &:last-of-type{ + border-bottom: 1px solid $border; + article.archive{ + border-bottom: none; + } + } + h1.archive-title{ + font-size: 25px; + font-weight: 300; + line-height: 35px; + width: 200px; + position: absolute; + top: 0; + padding-top: 30px; + border-top: 1px solid #fff; + &:before{ + content: ""; + position: absolute; + top: -2px; + width: 100%; + border-top: 1px solid #ddd; + } + } + article.archive{ + margin-left: 200px; + .meta{ + color: $font-meta; + span{ + margin-right: 30px; + padding-left: 30px; + display: inline-block; + } + a{ + color: $font-meta; + @include transition(0.3s); + &:hover{ + color: $font-main; + } + } + .date{ + background: image-url('date.png') 0 center no-repeat; + } + .tags{ + background: image-url('tags.png') 0 center no-repeat; + } + .comments{ + background: image-url('comments.png') 0 center no-repeat; + } + } + } +} \ No newline at end of file diff --git a/sass/parts/_article.scss b/sass/parts/_article.scss index eae9eaf..4423eee 100644 --- a/sass/parts/_article.scss +++ b/sass/parts/_article.scss @@ -95,33 +95,6 @@ article{ padding-left: 25px; } } - .meta{ - position: absolute; - top: 85px; - line-height: 2; - font-size: 13px; - color: $font-meta; - width: 170px; - a{ - color: $font-meta; - @include transition(0.3s); - &:hover{ - color: $font-main; - } - } - .date, .tags, .comments{ - padding-left: 30px; - } - .date{ - background: image-url('date.png') 0 center no-repeat; - } - .tags{ - background: image-url('tags.png') 0 center no-repeat; - } - .comments{ - background: image-url('comments.png') 0 center no-repeat; - } - } } .share{ padding: 15px 0; diff --git a/sass/parts/_post.scss b/sass/parts/_post.scss index bbd6029..b27b4c7 100644 --- a/sass/parts/_post.scss +++ b/sass/parts/_post.scss @@ -2,4 +2,31 @@ h1.title, .entry{ margin-left: 200px; } + .meta{ + position: absolute; + top: 85px; + line-height: 2; + font-size: 13px; + color: $font-meta; + width: 170px; + a{ + color: $font-meta; + @include transition(0.3s); + &:hover{ + color: $font-main; + } + } + .date, .tags, .comments{ + padding-left: 30px; + } + .date{ + background: image-url('date.png') 0 center no-repeat; + } + .tags{ + background: image-url('tags.png') 0 center no-repeat; + } + .comments{ + background: image-url('comments.png') 0 center no-repeat; + } + } } \ No newline at end of file diff --git a/source/_includes/archive_post.html b/source/_includes/archive_post.html index 5693f95..b30e5d8 100644 --- a/source/_includes/archive_post.html +++ b/source/_includes/archive_post.html @@ -1,8 +1,9 @@ {% capture category %}{{ post.categories | size }}{% endcapture %} -

{{post.title}}

- -{% if category != '0' %} - -{% endif %} \ No newline at end of file +

{{post.title}}

+
+ {{ post.date | date: "%b %e" }} + {% include post/categories.html %} + {% if site.disqus_short_name and post.comments == true %} + 留言 + {% endif %} +
\ No newline at end of file diff --git a/source/_layouts/category_index.html b/source/_layouts/category_index.html index 85a6307..7e64ebe 100644 --- a/source/_layouts/category_index.html +++ b/source/_layouts/category_index.html @@ -1,17 +1,16 @@ --- -layout: page -footer: false +layout: default --- -
{% for post in site.categories[page.category] %} -{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} -{% unless year == this_year %} - {% assign year = this_year %} -

{{ year }}

-{% endunless %} -
- {% include archive_post.html %} -
+
+ {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} + {% unless year == this_year %} + {% assign year = this_year %} +

{{ year }}

+ {% endunless %} +
+ {% include archive_post.html %} +
+
{% endfor %} -
diff --git a/source/blog/archives/index.html b/source/blog/archives/index.html index f1d9cee..043e163 100644 --- a/source/blog/archives/index.html +++ b/source/blog/archives/index.html @@ -1,18 +1,17 @@ --- -layout: page -title: Blog Archive -footer: false +layout: default +title: 文章彙整 --- -
{% for post in site.posts reverse %} -{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} -{% unless year == this_year %} - {% assign year = this_year %} -

{{ year }}

-{% endunless %} -
- {% include archive_post.html %} -
-{% endfor %} -
+
+ {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} + {% unless year == this_year %} + {% assign year = this_year %} +

{{ year }}

+ {% endunless %} +
+ {% include archive_post.html %} +
+
+{% endfor %} \ No newline at end of file -- cgit v1.1-2-g2b99