-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
112 lines (105 loc) · 3.65 KB
/
index.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
layout: default
permalink: /
---
<div class="container">
<div class="col-lg-12 text-center" style="margin-top: 7rem;margin-bottom: 7rem;">
<picture>
<img src="{{site.url}}/assets/img/banner.png" srcset="{{srcset}}" />
</picture>
</div>
<div class="row">
<div id="recent-events" class="col-md-6 col-md-push-6">
<h2> 活动与授课 </h2>
{% for event in site.categories['event'] limit:6 %}
<div class="event" data-event-date="{{event.date | date: " %F"}}">
<div class="event-title">
<a href="{{ event.url | prepend: site.baseurl }}">
<h4>{{ event.title }}</h4>
</a>
</div>
<div class="event-meta">
<span><strong>时间: </strong>{{event.date | date: "%F"}}{% if event.time %} {{event.time}} {% endif %}</span>
<span><strong>地点:</strong> {{event.place}}</span>
<span class="event-status">
</span>
{% if event.podcast or event.bilibili or event.slides %}
<br>
<span><strong>资源: </strong></span>
{% if event.audio %}
<a data-toggle="tooltip" title="播客" class="label label-info" href="{{event.podcast}}" target="_blank"><i
class="fa fa-podcast fa-fw"></i></a>
{% endif %}
{% if event.bilibili %}
<a data-toggle="tooltip" title="Bilibili" class="label label-info" href="{{event.bilibili}}"
target="_blank"><i class="fa fa-video-camera fa-fw"></i></a>
{% endif %}
{% if event.slides %}
<a data-toggle="tooltip" title="讲稿" class="label label-info" href="{{event.slides}}" target="_blank"><i
class="fa fa-file-alt fa-fw"></i></a>
{% endif %}
{% endif %}
</div>
<div class="event-abstract">
{{ event.excerpt | strip_html | truncate: 240, '...'}}
</div>
</div>
{% endfor %}
<div>
<a href={{"/events/"|prepend: site.baseurl}}>更多</a>
</div>
</div>
<div id="recent-posts" class="col-md-6 col-md-pull-6">
<h2> 最新博客 </h2>
{% for post in site.categories['blog'] limit:6 %}
<div class="post">
<div class="post-title">
<a href="{{ post.url | prepend: site.baseurl }}">
<h4><i class="fa fa-file-text-o"></i> {{ post.title }}</h4>
</a>
</div>
<div class="post-meta">
{{post.author}}, {{post.date | date: "%Y-%-m-%-d"}}
</div>
<div class="post-abstract">
{{ post.excerpt | strip_html | truncate: 240, '...'}}
</div>
</div>
{% endfor %}
<div>
<a href={{"/blog/"|prepend: site.baseurl}}>更多</a>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
var today = function () {
var pad = function (number) {
var r = String(number);
if (r.length === 1) {
r = '0' + r;
}
return r;
}
var _today = new Date();
return Date.parse(
_today.getFullYear().toString() + "-"
+ pad(_today.getMonth() + 1) + "-"
+ pad(_today.getDate())
);
}();
$('#recent-events .event').each(function () {
// console.log($(this).attr("data-event-date"));
var event_date = Date.parse($(this).attr("data-event-date")),
label = "";
if (today > event_date) {
label = "<span class='label label-info'>已结束</span>";
} else {
label = "<span class='label label-warning'>即将举办</span>";
}
$(this).find(".event-status").append(label);
});
});
</script>