Skip to content

Commit e136550

Browse files
committed
archive
1 parent 6381364 commit e136550

File tree

10 files changed

+165
-74
lines changed

10 files changed

+165
-74
lines changed

_includes/category.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{% capture categories %}
2+
{% if post %}
3+
{% for category in post.categories %}
4+
<a href="{{ root_url }}/{{ site.category_dir }}#{{ category }}-ref" title="Category: {{ category }}" rel="category">{{ category | join: "/" }}</a>{% unless forloop.last %}&nbsp;{% endunless %}
5+
{% endfor %}
6+
{% else %}
7+
{% for category in page.categories %}
8+
<a href="{{ root_url }}/{{ site.category_dir }}#{{ category }}-ref" title="Category: {{ category }}" rel="category">{{ category | join: "/" }}</a>{% unless forloop.last %}&nbsp;{% endunless %}
9+
{% endfor %}
10+
{% endif %}
11+
{% endcapture %}
12+
{% capture category_size %}{{ categories | strip_newlines | replace: ' ', '' | size }}{% endcapture %}
13+
{% unless category_size == '0' %}
14+
<!-- <span class="point">•</span> -->
15+
<span class="categories">
16+
<i class="fa fa-th-list"></i>{{ categories }}
17+
<!-- <span class="point">•</span> -->
18+
</span>
19+
{% endunless %}

_includes/tag.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{% capture tags %}
2+
{% if post %}
3+
{% for tag in post.tags %}
4+
<a href="{{ root_url }}/{{ site.tag_dir }}#{{ tag }}-ref" title="Tag: {{ tag }}" rel="tag">{{ tag | join: "/" }}</a>{% unless forloop.last %}&nbsp;{% endunless %}
5+
{% endfor %}
6+
{% else %}
7+
{% for tag in page.tags %}
8+
<!--a href="{{ root_url }}/{{ site.tag_dir }}#{{ tag | cgi_escape }}-ref" title="Tag: {{ tag }}" rel="tag">{{ tag | join: "/" }}</a-->
9+
<a href="{{ root_url }}/{{ site.tag_dir }}#{{ tag }}-ref" title="Tag: {{ tag }}" rel="tag">{{ tag | join: "/" }}</a>{% unless forloop.last %}&nbsp;{% endunless %}
10+
{% endfor %}
11+
{% endif %}
12+
{% endcapture %}
13+
<!-- <span class="point">•</span> -->
14+
<span class="pageTag">
15+
<i class="fa fa-tags"></i>{{ tags }}
16+
</span>

_layouts/page.html

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
---
22
layout: default
33
---
4-
<article class="post">
54

6-
<!-- <header class="post-header"> -->
7-
<h1 class="post-title">{{ page.title }}</h1>
8-
<!-- </header> -->
5+
<h1 class="post-title">{{ page.title }}</h1>
96

10-
<div>
7+
<div>
118
{{ content }}
12-
</div>
13-
14-
</article>
9+
</div>

_layouts/post.html

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,43 +27,11 @@ <h1>{{ page.title }}</h1>
2727
</div>
2828

2929
<div class="label-card">
30-
{% capture categories %}
31-
{% if post %}
32-
{% for category in post.categories %}
33-
<a href="{{ root_url }}/{{ site.category_dir }}#{{ category }}-ref" title="Category: {{ category }}" rel="category">{{ category | join: "/" }}</a>{% unless forloop.last %},{% endunless %}
34-
{% endfor %}
35-
{% else %}
36-
{% for category in page.categories %}
37-
<a href="{{ root_url }}/{{ site.category_dir }}#{{ category }}-ref" title="Category: {{ category }}" rel="category">{{ category | join: "/" }}</a>{% unless forloop.last %},{% endunless %}
38-
{% endfor %}
39-
{% endif %}
40-
{% endcapture %}
41-
{% capture category_size %}{{ categories | strip_newlines | replace: ' ', '' | size }}{% endcapture %}
42-
{% unless category_size == '0' %}
43-
<!-- <span class="point">•</span> -->
44-
<span class="categories">
45-
<i class="fa fa-th-list"></i>{{ categories }}<span class="point"></span>
46-
</span>
47-
{% endunless %}
30+
{% include category.html %}<span class="point"></span>
4831
</div>
4932

5033
<div class="label-card">
51-
{% capture tags %}
52-
{% if post %}
53-
{% for tag in post.tags %}
54-
<a href="{{ root_url }}/{{ site.tag_dir }}#{{ tag }}-ref" title="Tag: {{ tag }}" rel="tag">{{ tag | join: "/" }}</a>{% unless forloop.last %},{% endunless %}
55-
{% endfor %}
56-
{% else %}
57-
{% for tag in page.tags %}
58-
<!--a href="{{ root_url }}/{{ site.tag_dir }}#{{ tag | cgi_escape }}-ref" title="Tag: {{ tag }}" rel="tag">{{ tag | join: "/" }}</a-->
59-
<a href="{{ root_url }}/{{ site.tag_dir }}#{{ tag }}-ref" title="Tag: {{ tag }}" rel="tag">{{ tag | join: "/" }}</a>{% unless forloop.last %}&nbsp;{% endunless %}
60-
{% endfor %}
61-
{% endif %}
62-
{% endcapture %}
63-
<!-- <span class="point">•</span> -->
64-
<span class="pageTag">
65-
<i class="fa fa-tags"></i>{{ tags }}
66-
</span>
34+
{% include tag.html %}
6735
</div>
6836

6937
</div>

_posts/2015-07-24-low-IE-click-empty-block-bug.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ layout: post
33
title: "在低版本 IE 中点击空 block 元素的问题"
44
date: 2015-07-24 00:06:05
55
categories: CSS
6+
tags: IE CSS
67
excerpt: 低版本IE的bug和兼容性,点击空块级元素时
78
---
89

@@ -27,4 +28,4 @@ excerpt: 低版本IE的bug和兼容性,点击空块级元素时
2728

2829
background-color: #fff;
2930
opacity: 0;
30-
filter:alpha(opacity=0);
31+
filter:alpha(opacity=0);

_sass/_page.scss

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
.page {
2+
width: 1140px;
3+
margin: 0 auto;
4+
position: relative;
5+
.left {
6+
width: 840px;
7+
padding: 20px 30px;
8+
line-height: 1.6;
9+
font-size: 16px;
10+
background-color: #f8f8fd;
11+
box-shadow: 0 1px 2px rgba(0,0,0,0.4),0 0 30px rgba(10,10,0,0.1) inset;
12+
>h1 {
13+
margin-bottom: -10px;
14+
}
15+
ul {
16+
>h2 {
17+
margin-left: -40px;
18+
color: #6a6b6b;
19+
}
20+
li {
21+
color: #888888;
22+
time {
23+
display: inline-block;
24+
width: 135px;
25+
}
26+
.title {
27+
font-weight: bold;
28+
color: #223253;
29+
transition: 0.3s ease;
30+
&:hover {
31+
color: #4d6dad;
32+
}
33+
}
34+
i{
35+
margin-right: 5px;
36+
}
37+
.categories {
38+
padding: 0 15px;
39+
i{
40+
color: #9e9d9d;
41+
}
42+
a{
43+
// border: 1px solid #aaa;
44+
padding: 0 5px;
45+
background-color: #9e9d9d;
46+
color: #fff;
47+
font-size: 80%;
48+
transition: 0.3s ease;
49+
&:hover {
50+
background-color: #b6b6b9;
51+
// color: #4d6dad;
52+
}
53+
}
54+
}
55+
.pageTag {
56+
i{
57+
color: #c6cbe9;
58+
}
59+
a{
60+
// border: 1px solid #aaa;
61+
padding: 0 5px;
62+
background-color: #c6cbe9;
63+
border-radius: 4px;
64+
color: #fff;
65+
font-size: 80%;
66+
transition: 0.3s ease;
67+
&:hover {
68+
background-color: #c0ddc7;
69+
// color: #4d6dad;
70+
}
71+
}
72+
}
73+
}
74+
}
75+
}
76+
.right {
77+
position: absolute;
78+
left:860px;
79+
top: 0;
80+
background: red;
81+
.side {}
82+
}
83+
}

_sass/_post.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
overflow: hidden;
55
padding: 5px;
66
.post {
7-
width: 776px;
7+
width: 836px;
88
float: left;
99
padding: 20px 30px;
1010
margin-right: 20px;
@@ -45,7 +45,7 @@
4545
}
4646
.fixed{
4747
position: fixed;
48-
right: 267px;
48+
right: 266px;
4949
top:20px;
5050
}
5151
.sidebar {

_sass/_reset.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ h5,
1313
h6{
1414
padding: 0;
1515
margin: 0;
16+
box-sizing: border-box;
1617
}
1718
h1,
1819
h2,

css/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"reset",
5353
"header",
5454
"post",
55+
"page",
5556
"syntax-highlighting"
5657
;
5758

page/1archives.html

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,50 @@
11
---
2-
layout: page
2+
layout: default
33
title: Archive
44
permalink: /archive/
55
icon: archive
66
---
77

88
<!-- <h1>Archive of posts with {{ page.type }} '{{ page.title }}'</h1> -->
99

10-
<ul>
11-
{% for post in site.posts %}
12-
13-
{% unless post.next %}
14-
<h2>{{ post.date | date: '%Y' }}</h2>
15-
{% else %}
16-
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
17-
{% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
18-
{% if year != nyear %}
19-
<h2>{{ post.date | date: '%Y' }}</h2>
20-
{% endif %}
21-
{% endunless %}
22-
23-
<li>
24-
{{ post.date | date:"%F" }} {{ post.date | date: "%A" }}
25-
<a href="{{ post.url }}">{{ post.title }}</a>
26-
Cate:
27-
{% for cate in post.categories %}
28-
<span>{{cate}}</span>
29-
{% endfor %}
30-
Tags:
31-
{% for tag in post.tags %}
32-
<span>{{tag}}</span>
33-
{% endfor %}
3410

35-
</li>
11+
<div class="page">
12+
<div class="left">
13+
<h1>{{page.title}}</h1>
14+
<hr>
15+
<ul>
16+
{% for post in site.posts %}
17+
18+
{% unless post.next %}
19+
<h2>{{ post.date | date: '%Y' }}</h2>
20+
{% else %}
21+
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
22+
{% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
23+
{% if year != nyear %}
24+
<h2>{{ post.date | date: '%Y' }}</h2>
25+
{% endif %}
26+
{% endunless %}
27+
28+
<li>
29+
<time>
30+
{{ post.date | date:"%F" }} {{ post.date | date: "%a" }}.
31+
</time>
32+
<a class="title" href="{{ post.url }}">{{ post.title }}</a>
33+
34+
{% include category.html %}
35+
{% include tag.html %}
36+
</li>
37+
38+
{% endfor %}
39+
</ul>
40+
</div>
41+
<div class="right">
42+
<div class="side">aaa</div>
43+
<div class="side">bbbb</div>
44+
</div>
45+
</div>
3646

37-
{% endfor %}
38-
</ul>
3947

40-
<hr>
4148

4249
<!-- <ul class="posts">
4350
{% for post in site.posts %}

0 commit comments

Comments
 (0)