forked from Ovilia/blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
all.html
97 lines (89 loc) · 3.57 KB
/
all.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
layout: default
---
<title>All Posts - Wenli Zhang</title>
<div class="simpleNav">
<a href="http://zhangwenli.com" class="pageDiv" onclick="_gaq.push(['_trackEvent', 'ToHome', 'InAll', window.location.pathname]);">Home</a>
<a href="{{ site.url }}" class="pageDiv" onclick="_gaq.push(['_trackEvent', 'ToBlog', 'InAll', window.location.pathname]);">Blog</a>
</div>
<div class="pageTitle">All Posts</div>
{% include license.html %}
{% assign lastMonth = '' %}
{% for post in site.posts %}
{% if post.hide != true %}
{% capture month %}{{ post.time | date: "%Y-%m "}}{% endcapture %}
{% if lastMonth != month %}
<h1>{{ month }}</h1>
{% assign lastMonth = month %}
{% endif %}
{% assign isZn = false %}
{% for tag in post.tags %}
{% if tag == '中文'%}
{% assign isZn = true %}
{% endif %}
{% endfor %}
<div class="post-block{% if isZn %} cn{% endif %}{% for tag in post.tags %} tag-{{ tag }}{% endfor%}">
<div class="timeago" title="{{ post.time | replace: '.', '-' | replace: ' ', 'T' }}+08:00">{{ post.time }}</div>
<h5 class="post-series">
{% if post.series %}
<a href="{{ site.url }}{{ post.url }}" class="series-recent" onclick="_gaq.push(['_trackEvent', 'ToSeries', '{{ postCnt.size }}thPost', window.location.pathname]);">
{% if isZn %}
系列博文:{{ post.series }}
{% else %}
In Series: {{ post.series }}
{% endif %}
</a>
{% endif %}
</h5>
<h2><a href="{{ site.url }}{{ post.url }}" onclick="_gaq.push(['_trackEvent', 'ToPost', 'InAll', '{{ post.url }}']);">
{% if isZn %}
{{ post.title }}{% if post.subtitle != null %}:{{ post.subtitle }}{% endif %}
{% else %}
{% if post.subtitle != null %}{{ post.subtitle }} {% endif %}{{ post.title }}
{% endif %}
</a></h2>
<div class="tagPanel">
{% for tag in post.tags %}
<a href="{{ site.url }}/all/?tag={{ tag }}" onclick="_gaq.push(['_trackEvent', 'ToTag', 'InAll', '{{ tag }}']);"><div class="tag">{{ tag }}</div></a>
{% endfor%}
</div>
{{ post.excerpt | markdownify }}
</div>
{% endif %}
{% endfor %}
<script type="text/javascript">
// function queryString is copied from
// http://stackoverflow.com/questions/979975/how-to-get-the-value-from-url-parameter#answer-979995
function queryString() {
// This function is anonymous, is executed immediately and
// the return value is assigned to QueryString!
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = pair[1];
// If second entry with this name
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]], pair[1] ];
query_string[pair[0]] = arr;
// If third or later entry with this name
} else {
query_string[pair[0]].push(pair[1]);
}
}
return query_string;
}
window.jQueryCallBack = function() {
var query = queryString();
if (query.tag !== undefined) {
var tag = decodeURI(query.tag);
var tagClassName = tag.replace(new RegExp('\\.', 'g'), '\\.');
$('.pageTitle').text('Posts tagged with ' + tag);
$('h1').hide();
$('.post-block').not('.tag-' + tagClassName).hide();
}
};
</script>