-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathblog.html
More file actions
316 lines (295 loc) · 14.3 KB
/
blog.html
File metadata and controls
316 lines (295 loc) · 14.3 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
---
layout: default_new
image: /images/opengraph/blog_og.jpg
title: "Metabase Blog: news, analytics and BI, data explorations, and more"
---
<script src="//cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js"></script>
<div class="bootstrap">
<div class="blog-page bg-neutral-98-gradient">
<div class="container pt-4">
<section class="d-flex flex-column flex-lg-row pb-0">
<h1 class="h3 mb-lg-0">Blog</h1>
<div class="bg-neutral-80 ms-8 me-8 d-none d-lg-block" style="height: 40px; width: 1px;"></div>
<div class="d-flex flex-wrap align-items-center">
<p class="paragraph-5 neutral-60 mb-0 me-2 me-md-6 mb-2">Explore by category:</p>
<div class="d-flex flex-row align-items-center flex-wrap">
{% assign filters = "" %}
{% for post in site.posts %}
{% assign category = post.categories | join: " " %}
{% assign filters = filters | append: category | append: "," %}
{% endfor %}
{% assign filters = filters | split: "," | uniq %}
{% for filter in filters %}
<div class="btn-base btn-base-toggle py-2 px-3 align-items-center justify-content-center rounded-3 fs-12 me-2 mb-2">
{{ filter }}
</div>
{% endfor %}
</div>
</div>
</section>
<div class="row">
<div class="col-xs-12 col-lg-8">
<section class="pb-0 pb-lg-8">
<div id="recent-post-list">
<div class="list pe-lg-20">
{% for post in site.posts %}
<div class="hover-raise-sm mb-8">
<div class="card hover-shadow hover-pointer bg-neutral-white border-0 rounded-3 p-6">
{% if post.featured_image %}
<img
alt="{{ post.title }} Image"
class="w-100 rounded-2 mb-8"
src="{{ post.featured_image }}" />
{% endif %}
<span class="paragraph-5 neutral-60 mb-3">{{ post.date | date: "%b %d, %Y" }} in
<b class="category-name">{{ post.categories | join: " " }}</b>
</span>
<h4 class="blog-title mb-4">{{ post.title }}</h4>
<p class="paragraph-5 mb-6 neutral-40">{{ post.summary }}</p>
<div class="d-flex flex-row align-items-center">
{% assign author = site.blog-authors | where: "author", post.author | first %}
<img
alt="{{ post.author }} Portrait"
class="circle me-2"
height="36"
src="{{ author.author_avatar }}"
width="36" loading="lazy"/>
<h5 class="neutral-40 mb-0 me-2">{{ post.author }}</h5>
{% assign words = post.content | number_of_words %}
<p class="paragraph-5 neutral-60 mb-0">‧
{% if words < 360 %}1
{% else %}
{{ words | divided_by: 238 }}{% endif %}
min read</p>
</div>
<a class="stretched-link h-0" href="{{ post.url }}"></a>
</div>
</div>
{% endfor %}
</div>
</div>
</section>
<section class="d-block d-lg-none col-12 mb-8 pt-0 pt-lg-8" id="mobile-releases">
<h4 class="mb-0">Releases</h4>
{% assign latest_releases = site.releases | reverse %}
{% for release in latest_releases limit: 3 %}
<div class="blog-release-card card hover-pointer bg-transparent border-0 mt-11">
<div class="d-flex flex-row align-items-center mb-2">
<p class="paragraph-5 neutral-60 fw-bold m-0">{{ release.date | date: "%b %Y" }}</p>
{% if forloop.first == true %}
{% assign release_date = release.date | date: "%s" %}
{% assign date_diff = "now" | date: "%s" | minus: release_date | divided_by: 3600 | divided_by: 24 | round %}
{% if date_diff <= 30 %}
<div class="blog-new-release px-2 rounded-1 bg-blue-60 ms-2">
<h5 class="m-0 neutral-white">New</h5>
</div>
{% endif %}
{% endif %}
</div>
<h4 class="mb-3">{{ release.title | split: "-" | first }}</h4>
<p class="paragraph-5 neutral-60 mb-0">{{ release.summary }}</p>
<a
class="stretched-link h-0"
href="{{ release.url }}?from_page=blog"
target="_blank"></a>
</div>
{% endfor %}
<a class="chevron blue-small-right mt-6 mt-md-8" href="/releases">See more</a>
<!-- Begin MailChimp Signup Form -->
<div
class="bg-blue-95 mt-12 p-6 pb-4 rounded-4"
id="mc_embed_signup"
style="max-width: 592px;">
<form
action="//metabase.us10.list-manage.com/subscribe/post?u=869fec0e4689e8fd1db91e795&id=b9664113a8"
class="validate"
id="mc-embedded-subscribe-form"
method="post"
name="mc-embedded-subscribe-form"
novalidate
target="_blank">
<div id="mc_embed_signup_scroll">
<h3 class="mb-4 mt-0">Subscribe to our newsletter</h3>
<span class="paragraph-5 neutral-40 mb-3 d-block">Stay in touch with updates and news from Metabase.<br>No spam, ever.</span>
<div class="mc-field-group">
<div class="d-flex mb-2 flex-column flex-sm-row">
<input
class="required email input input-small bordered {% if include.color %}border-darkblue{% endif %} me-0 me-sm-2 mb-2 mb-sm-0"
id="mce-EMAIL"
name="EMAIL"
placeholder="Email Address"
style="flex-grow: 1;"
tabindex="-1"
type="email"
value="" />
<input
class="Button Button--primary"
id="mc-embedded-subscribe"
name="subscribe"
type="submit"
value="Sign Up" />
</div>
</div>
<div class="clear" id="mce-responses">
<div
class="response"
id="mce-error-response"
style="display:none"></div>
<div
class="response"
id="mce-success-response"
style="display:none"></div>
</div>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;">
<input
name="b_869fec0e4689e8fd1db91e795_b9664113a8"
tabindex="-1"
type="text"
value="" />
</div>
</div>
</form>
<script type="text/javascript">
document.getElementById('mc-embedded-subscribe-form').action = `//metabase.us10.list-manage.com/subscribe/post?u=869fec0e4689e8fd1db91e795&id=b9664113a8&SIGNUP=${window.location.href}`;
</script>
</div>
<!--End mc_embed_signup-->
</section>
<section>
{% assign current_year = 0 %}
<div id="previous-post-list">
<div class="list pe-lg-20">
<div>
<h4 class="previous-posts-header mb-11">Previous posts</h4>
</div>
{% for post in site.posts %}
{% assign post_year = post.date | date: "%Y" %}
{% if post_year != current_year %}
{% assign current_year = post_year %}
<div>
<h5 class="header-year neutral-60 mb-6">{{ current_year }}</h5>
</div>
{% endif %}
<div class="previous-post-card card hover-pointer bg-transparent border-0 mb-11">
<h4 class="blog-title">{{ post.title }}</h4>
{% assign words = post.content | number_of_words %}
<span class="paragraph-5 neutral-60 mb-3">{{ post.date | date: "%b %d, %Y" }} in
<b class="category-name">{{ post.categories | join: " " }}</b>
‧
{% if words < 360 %}1
{% else %}
{{ words | divided_by: 180 }}{% endif %}
min read</span>
<p class="post-year h-0 m-0 invisible">{{ post_year }}</p>
<a class="stretched-link h-0" href="{{ post.url }}"></a>
</div>
{% endfor %}
</div>
</div>
</section>
</div>
<section class="d-none d-lg-block col-lg-4">
<h4 class="mb-0">Releases</h4>
{% assign latest_releases = site.releases | reverse %}
{% for release in latest_releases limit: 3 %}
<div class="blog-release-card card hover-pointer bg-transparent border-0 mt-11">
<div class="d-flex flex-row align-items-center mb-2">
<p class="paragraph-5 neutral-60 fw-bold m-0">{{ release.date | date: "%b %Y" }}</p>
{% if forloop.first == true %}
{% assign release_date = release.date | date: "%s" %}
{% assign date_diff = "now" | date: "%s" | minus: release_date | divided_by: 3600 | divided_by: 24 | round %}
{% if date_diff <= 30 %}
<div class="blog-new-release px-2 rounded-1 bg-blue-60 ms-2">
<h5 class="m-0 neutral-white">New</h5>
</div>
{% endif %}
{% endif %}
</div>
<h4 class="mb-3">{{ release.title | split: "-" | first }}</h4>
<p class="paragraph-5 neutral-60 mb-0">{{ release.summary }}</p>
<a class="stretched-link h-0" href="{{ release.url }}?from_page=blog"></a>
</div>
{% endfor %}
<a class="chevron blue-small-right mt-6 mt-md-8" href="/releases">See more</a>
<div class="mt-13" style="position: sticky; top: 136px;">
{% include post-signup-form.html id = "1" %}
</div>
</section>
</div>
</div>
</div>
</div>
<script src="/js/header.js" type="text/javascript"></script>
<script type="text/javascript">
const recentPostList = new List('recent-post-list', {
valueNames: ['blog-title', 'category-name']
});
const previousPostList = new List('previous-post-list', {
valueNames: ['previous-posts-header', 'blog-title', 'category-name', 'header-year', 'post-year']
});
const resetRecentPostList = function() {
let index = 0;
recentPostList.filter(function(item) {
index += 1;
return index <= 3;
});
}
const resetPreviousPostList = function() {
let index = 0;
previousPostList.filter(function(item) {
// always include headers
if (item.values()['header-year'] || item.values()['previous-posts-header']) {
return true;
}
index += 1;
return index > 3;
});
}
resetRecentPostList();
resetPreviousPostList();
const mobileReleases = document.getElementById('mobile-releases');
const selectFilterToggleElement = function(element) {
const filterButtons = document.querySelectorAll('.btn-base-toggle');
filterButtons.forEach(filter => {
if (element !== filter) {
filter.classList.remove('selected');
}
});
if (element.matches('.selected')) {
mobileReleases.classList.remove('d-none');
resetRecentPostList();
resetPreviousPostList();
} else {
mobileReleases.classList.add('d-none');
let recentPostMatch = null;
recentPostList.filter(function(item) {
const match = item.values()['category-name'].replaceAll('&', '&') === element.innerText;
const show = match && recentPostMatch === null;
if (show) {
recentPostMatch = item.values()['blog-title'];
}
return show;
});
previousPostList.filter(function(item) {
if (item.values()['header-year']) {
const itemsWithHeaderYear = previousPostList.items.filter(function(previousPostItem) {
return previousPostItem.values()['post-year'] === item.values()['header-year'] &&
previousPostItem.values()['category-name'].replaceAll('&', '&') === element.innerText &&
previousPostItem.values()['blog-title'] !== recentPostMatch;
})
return itemsWithHeaderYear.length > 0;
} else {
return item.values()['category-name'].replaceAll('&', '&') === element.innerText &&
item.values()['blog-title'] !== recentPostMatch;
}
});
}
element.classList.toggle('selected');
}
document.addEventListener('click', function (event) {
const element = event.target;
if (!element.matches('.btn-base-toggle')) return;
event.preventDefault();
selectFilterToggleElement(element);
}, false);</script>