-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
154 lines (150 loc) · 4.08 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
---
layout: default
---
<style>
.index-system h2 {
border-left: 0 !important;
padding-left: 0 !important;
}
.index-system h2.incident-warning::before {
content: "⚠️";
}
.index-system h2.incident-error::before {
content: "❌";
}
.index-system h2::before {
content: "✔️";
}
.index-heading {margin-top: 0;}
</style>
<meta name="description" content="{{ site.description }}" />
<h1 class="site-title">
<a href="/" title="{{ site.title }}">
{{ site.title }}
</a>
</h1>
{% for tag in site.data.tags %}
{% if tag.scheduled %}
<div class="posts">
{% assign post = site.tags[tag.slug][0] %}{% if post.action contains 'resolve' %}{% assign post = nil %}{% endif %}
{% if post %}
<div class="post {{ post.action }}">
<h3>
<span class="tags">
<span class="tag {{ tag.slug }}">
{{ tag.name }}
</span>
</span>
<a href="{{ post.url }}">
{{ post.title }}
</a>
</h3>
<div class="content">
{{ post.content }}
</div>
</div>
{% endif %}
</div>
{% endif %}
{% endfor %}
{% for tag in site.data.tags %}
{% if tag.system %}
<div class="index-system">
{% assign post = site.tags[tag.slug][0] %}{% if post.action contains 'incident' %}
{% else %}{% assign post = nil %}{% endif %}
<div class="index-heading">
<h2 class="{{ post.action }}">
{{ tag.name }}
</h2>
</div>
<hr/>
{% if post %}
<div class="{{ post.action }}">
<h3>
<a href="{{ post.url }}">
{{ post.title }}
</a>
</h3>
<div class="content">
{{ post.content }}
</div>
</div>
{% endif %}
</div>
{% endif %}
{% endfor %}
<div class="index-heading">
<h2>
Uptime Last {{ site.uptime_days }} Days
</h2>
</div>
<hr/>
<div class="uptime" style="display: none">
{% for post in site.posts limit:100 %}
<span class="{{ post.action }}" data-action="{{ post.action }}" data-url="{{ post.url }}" data-title="{{ post.title }}" data-date="{{ post.date | date_to_xmlschema }}">
</span>
{% endfor %}
</div>
<div class="uptime-scale">
<span>
{{ site.uptime_days }} Days Ago
</span>
<span>
Latest
</span>
</div>
<div class="index-heading">
<h2>
Past Events
</h2>
<a href="/archive">
View Archive
</a>
</div>
<hr/>
<div id="posts" class="posts">
{% for post in site.posts limit:6 %}
<div class="post {{ post.action }}">
<h3>
<a href="{{ post.url }}">
{{ post.title }}
</a>
</h3>
<span>{{ post.date | date_to_string }}</span>
</div>
{% endfor %}
</div>
<script>
(function() {
var wrapper = document.querySelector('.uptime'),
posts = document.querySelectorAll('.uptime span'),
span = false,
a = false,
dayp = false,
n = new Date(),
day = (1000 * 60 * 60 * 24),
o = new Date(n.getTime() - day * {{ site.uptime_days }}),
diff = Math.floor((n.getTime() - o.getTime()) / day),
i, j = 0;
for (j = diff; j >= 0; j--) {
span = document.createElement('span');
n = (new Date(o.getTime() + day * (diff - j)));
span.title = n.toDateString();
span.setAttribute('data-date', n.toJSON().slice(0, 10));
wrapper.appendChild(span);
}
for (i = 0; i < posts.length; i++) {
a = document.createElement('a');
n = (new Date(posts[i].dataset.date));
a.title = n.toDateString() + ' ' + posts[i].dataset.title;
a.className = posts[i].dataset.action;
a.href = posts[i].dataset.url;
dayp = wrapper.querySelector('[data-date="' + n.toJSON().slice(0, 10) + '"]');
if (dayp) {
dayp.appendChild(a);
}
wrapper.removeChild(posts[i]);
}
wrapper.style.display = '';
})();
</script>