-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublications-en.html
More file actions
126 lines (117 loc) · 4.38 KB
/
publications-en.html
File metadata and controls
126 lines (117 loc) · 4.38 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
---
layout: default
lang: en
title: Publications
permalink: /publications/
page_id: publications-index
---
<div class="page-header">
<h1>Publications</h1>
</div>
<div class="category-filter" id="categoryFilter">
<span class="category-filter-label">Category:</span>
<button class="category-btn active" data-category="all">All</button>
<button class="category-btn" data-category="eHealth">eHealth</button>
<button
class="category-btn"
data-category="Machine Learning & Data Science"
>
Machine Learning & Data Science
</button>
<button
class="category-btn"
data-category="Computer Vision & Augmented Reality"
>
Computer Vision & Augmented Reality
</button>
</div>
<div class="listing-items">
{% assign en_pubs = site.publications | where: "lang", "en" | sort: "date" |
reverse %} {% assign year = "" %} {% for pub in en_pubs %} {% assign
pub_year = pub.date | date: "%Y" %} {% if pub_year != year %}
<h2 class="mt-3 year-heading" data-year="{{ pub_year }}">{{ pub_year }}</h2>
{% assign year = pub_year %} {% endif %}
<div
class="listing-item publication-entry collapsible"
data-category="{{ pub.category | default: '' }}"
>
<h3 class="listing-title" id="{{ pub.permalink | slugify }}">
{{ pub.title }}
</h3>
<div class="listing-content">
{% if pub.reference %}
<p class="publication-meta">{{ pub.reference }}</p>
{% endif %} {% if pub.doi %}
<p class="publication-links">
<strong>DOI:</strong>
<a
href="{{ pub.doi }}"
class="doi-link"
target="_blank"
rel="noopener"
>{{ pub.doi | remove: "https://doi.org/" }}</a
>
</p>
{% endif %} {% if pub.external_url %}
<p class="publication-links">
<strong>Link:</strong>
<a href="{{ pub.external_url }}" target="_blank" rel="noopener"
>{{ pub.external_url }}</a
>
</p>
{% endif %} {% if pub.content and pub.content != "" %}
<div class="publication-abstract">{{ pub.content }}</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
<script>
(function () {
var filterContainer = document.getElementById("categoryFilter");
if (!filterContainer) return;
var buttons = filterContainer.querySelectorAll(".category-btn");
var items = document.querySelectorAll(
".publication-entry[data-category]",
);
var yearHeadings = document.querySelectorAll(".year-heading");
buttons.forEach(function (btn) {
btn.addEventListener("click", function () {
buttons.forEach(function (b) {
b.classList.remove("active");
});
btn.classList.add("active");
var selectedCategory = btn.getAttribute("data-category");
items.forEach(function (item) {
var itemCategory = item.getAttribute("data-category");
if (
selectedCategory === "all" ||
itemCategory === selectedCategory
) {
item.style.display = "";
} else {
item.style.display = "none";
}
});
// Show/hide year headings based on visible items below them
yearHeadings.forEach(function (heading) {
var nextEl = heading.nextElementSibling;
var hasVisibleItems = false;
while (
nextEl &&
!nextEl.classList.contains("year-heading")
) {
if (
nextEl.classList.contains("publication-entry") &&
nextEl.style.display !== "none"
) {
hasVisibleItems = true;
}
nextEl = nextEl.nextElementSibling;
}
heading.style.display = hasVisibleItems ? "" : "none";
});
});
});
})();
</script>