This repository has been archived by the owner on Jan 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
news.html
125 lines (116 loc) · 4.6 KB
/
news.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
---
layout: default
theme: theme-green
title: News
---
<div class="main-content gradient-top">
<div class="container">
{% include title-block.html title=page.title %}
<div class="row justify-content-center py-5">
<div class="col col-md-7 col-sm-10 mb-5">
<div class="pb-4 news-filter">
<button class="btn btn-primary text-white" data-id="all" onclick="changeFilter(this);">All</button>
<button class="btn btn-primary text-white" data-id="press" onclick="changeFilter(this);">Press releases</button>
<button class="btn btn-primary text-white" data-id="papers" onclick="changeFilter(this);">Research</button>
<button class="btn btn-primary text-white" data-id="blog" onclick="changeFilter(this);">Blog posts</button>
<button class="btn btn-primary text-white" data-id="external" onclick="changeFilter(this);">External links</button>
</div>
{% assign posts = site.blog
| concat: site.external
| concat: site.press
| concat: site.papers
| sort: "date"
| reverse
%}
{% for post in posts %}
<div class="mb-5 {{ post.collection }}">
<h4>
<a href="{{ post.external_url | default: post.url }}">
{{ post.title }}
</a>
</h4>
<p class="mb-1">
{% if post.collection == "blog" %}
<span class="badge bg-red text-white">Blog post</span>
{% elsif post.collection == "external" %}
<span class="badge bg-purple text-white">External</span>
{% elsif post.collection == "papers" %}
<span class="badge bg-dark text-white">Research</span>
{% elsif post.collection == "press" %}
<span class="badge bg-primary text-white">Press release</span>
{% endif %}
<small>
posted {{ post.date | date: "%b %d, %Y" }}{% if post.author %} by {{ post.author }}{% endif %}
</small>
</p>
</div>
{% endfor %}
</div>
<div class="col-md-3 col-sm-10 mb-5">
<h5>Latest releases</h5>
<ul class="list-group mb-5">
{% assign releases = site.collections | where: 'label', 'releases' | first %}
{% for ordered in releases.order %}
{% for release in site.releases %}
{% if release.path contains ordered %}
<li class="list-group-item">
<div class="d-flex justify-content-between align-items-center">
<a href="{{ release.external_url }}">{{ release.name }}</a>
<a href="{{ release.versions[0].external_url }}" class="badge bg-light text-dark">
{{ release.versions[0].version }}
</a>
</div>
<div class="d-flex justify-content-between align-items-center">
<small class="text-dark">
{{ release.latest | date: "%b %d, %Y" }}
</small>
</div>
</li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
<h5>All releases</h5>
<ul class="list-group mb-5">
{% for ordered in releases.order %}
{% for release in site.releases %}
{% if release.path contains ordered %}
<li class="list-group-item">
<div class="d-flex justify-content-between align-items-center">
<a href="{{ release.external_url }}">{{ release.name }}</a>
</div>
<div class="row">
<div class="col-12 justify-content-between align-items-center">
{% for version in release.versions %}
<a href="{{ version.external_url }}" class="badge bg-light text-dark">
{{ version.version }}
</a>
{% endfor %}
</div>
</div>
</li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
<div class="border rounded">
<a class="twitter-timeline mt-5" data-height="600" href="https://twitter.com/abr_inc?ref_src=twsrc%5Etfw">Twitter Feed</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
</div>
<script>
const changeFilter = (btn) => {
const all = ['papers', 'press', 'blog', 'external'];
const selectedFilter = btn.getAttribute('data-id');
all.forEach(filter => {
if (filter === selectedFilter || selectedFilter == "all") {
$(`.${filter}`).show();
} else {
$(`.${filter}`).hide();
}
});
};
</script>