Skip to content

Commit 5e649af

Browse files
committed
add filters to publications list
1 parent 9003679 commit 5e649af

File tree

10 files changed

+198
-5
lines changed

10 files changed

+198
-5
lines changed

_includes/head/custom.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@
2323
</script>
2424
<script src="{{ '/assets/js/distillpub/template.v2.js' | relative_url }}"></script>
2525
<script src="{{ '/assets/js/distillpub/transforms.v2.js' | relative_url }}"></script>
26-
<script src="{{ '/assets/js/distillpub/overrides.js' | relative_url }}"></script>
26+
<script src="{{ '/assets/js/distillpub/overrides.js' | relative_url }}"></script>
27+
<script src="{{ '/assets/js/publications-filters.js' | relative_url }}"></script>

_includes/publications_list.html

Lines changed: 83 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,80 @@
11
<!--Get all the publications on the page-->
22
{% assign publications = site.publications | sort: 'date' | reverse %}
33

4+
{%- comment -%}
5+
Build filter option lists (venue, year, topic) from the publications collection.
6+
{%- endcomment -%}
7+
8+
{%- assign venues = site.publications | map: 'venue' | uniq | sort -%}
9+
10+
{%- assign years_string = '' -%}
11+
{%- assign topics_string = '' -%}
12+
{%- for publication in site.publications -%}
13+
{%- assign pub_year = publication.date | date: '%Y' -%}
14+
{%- unless years_string contains pub_year -%}
15+
{%- assign years_string = years_string | append: pub_year | append: '|' -%}
16+
{%- endunless -%}
17+
18+
{%- if publication.topics -%}
19+
{%- for topic in publication.topics -%}
20+
{%- unless topics_string contains topic -%}
21+
{%- assign topics_string = topics_string | append: topic | append: '|' -%}
22+
{%- endunless -%}
23+
{%- endfor -%}
24+
{%- endif -%}
25+
{%- endfor -%}
26+
27+
{%- assign years = years_string | split: '|' | sort | reverse -%}
28+
{%- assign topics = topics_string | split: '|' | sort -%}
29+
30+
<!--Filters-->
31+
<div class="publications__filters">
32+
<div class="publications__filters-group">
33+
<label for="pub-filter-topic">Topic</label>
34+
<select id="pub-filter-topic" class="publications__filter-select">
35+
<option value="">All topics</option>
36+
{%- for topic in topics -%}
37+
{%- if topic and topic != '' -%}
38+
<option value="{{ topic }}">{{ topic }}</option>
39+
{%- endif -%}
40+
{%- endfor -%}
41+
</select>
42+
</div>
43+
44+
<div class="publications__filters-group">
45+
<label for="pub-filter-year">Year</label>
46+
<select id="pub-filter-year" class="publications__filter-select">
47+
<option value="">All years</option>
48+
{%- for year in years -%}
49+
{%- if year and year != '' -%}
50+
<option value="{{ year }}">{{ year }}</option>
51+
{%- endif -%}
52+
{%- endfor -%}
53+
</select>
54+
</div>
55+
56+
<div class="publications__filters-group">
57+
<label for="pub-filter-venue">Venue</label>
58+
<select id="pub-filter-venue" class="publications__filter-select">
59+
<option value="">All venues</option>
60+
{%- for venue_key in venues -%}
61+
{%- if venue_key and venue_key != '' -%}
62+
<option value="{{ venue_key }}">{{ venue_key }}</option>
63+
{%- endif -%}
64+
{%- endfor -%}
65+
</select>
66+
</div>
67+
</div>
68+
469
<!--List all publications-->
5-
<ul class="publications__list">
70+
<ul class="publications__list" id="publications-list">
671
{% for publication in publications %}
7-
<li>
72+
<li
73+
class="publications__item"
74+
data-venue="{{ publication.venue }}"
75+
data-year="{{ publication.date | date: '%Y' }}"
76+
data-topics="{% if publication.topics %}{{ publication.topics | join: ',' }}{% endif %}"
77+
>
878
<a class="pub-title" href="{{ publication.url | relative_url }}">{{ publication.title }}</a>
979
<br>
1080
<span class="pub-authors">
@@ -25,10 +95,20 @@
2595
{% endif %}
2696
{% endfor %}
2797
</span>
98+
{% if publication.topics %}
99+
<br>
100+
<span class="pub-topics">
101+
{{ publication.topics | join: ', ' }}
102+
</span>
103+
{% endif %}
28104
<br>
29105
<span class="pub-venue">
30106
{% assign venue = site.data.venues[publication.venue] %}
31-
{{ venue.name }}
107+
{% if venue %}
108+
{{ venue.name }}
109+
{% else %}
110+
{{ publication.venue }}
111+
{% endif %}
32112
</span>
33113
</li>
34114
{% endfor %}

_publications/closing-real2sim-gap/closing_real2sim_gap.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ date: 2024-03-26 00:00:00 +00:00
1515
arxiv: https://arxiv.org/abs/2403.16092
1616
n_equal_contrib: 2
1717
thumbnail-img: front_figure.png
18+
topics:
19+
- Neural rendering
20+
- Simulation
21+
- Perception
1822
---
1923

2024
# Core idea

_publications/gasp/gasp.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ date: 2025-03-14 00:00:00 +00:00
1919
arxiv: https://arxiv.org/abs/2503.15672
2020
n_equal_contrib: 2
2121
thumbnail-img: thumbnail.gif
22+
topics:
23+
- Self-supervised learning
24+
- Perception
2225
---
2326
<div style="text-align: center; margin-bottom: 1em;">
2427
<h1>TLDR</h1>

_publications/neurad/neurad.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ date: 2023-11-26 00:00:00 +00:00
1515
arxiv: https://arxiv.org/abs/2311.15260
1616
n_equal_contrib: 3
1717
thumbnail-video: laneshift_compressed.mp4
18+
topics:
19+
- Neural rendering
20+
- Simulation
1821
---
1922

2023
<div style="display: flex; align-items: center; justify-content: center;">

_publications/neuro-ncap/neuro-ncap.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ date: 2024-04-12 00:00:00 +00:00
1616
arxiv: https://arxiv.org/abs/2404.07762
1717
n_equal_contrib: 2
1818
thumbnail-video: assets/videos/stationary-103-compressed-run1.mp4
19+
topics:
20+
- Neural rendering
21+
- Simulation
22+
- End-to-end
1923
---
2024

2125

_publications/splatad/splatad.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ date: 2024-11-30 00:00:00 +00:00
1414
arxiv: https://arxiv.org/abs/2411.16816
1515
n_equal_contrib: 2
1616
thumbnail-img: thumbnail.gif
17+
topics:
18+
- Neural rendering
19+
- Simulation
1720
---
1821
<div style="display: flex; justify-content: space-around; margin-bottom: 1em; margin-top: 0.5em; width=100%">
1922
<figure class="figure__background">

_publications/voxel-mae/voxel-mae.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ n_equal_contrib: 1
1515
code:
1616
arxiv: https://arxiv.org/abs/2207.00531
1717
thumbnail-img: thumbnail.png
18+
topics:
19+
- Self-supervised learning
1820
---
1921

2022
# Abstract

_sass/publications_list.scss

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,35 @@
1+
.publications__filters {
2+
display: flex;
3+
flex-wrap: wrap;
4+
gap: 0.75rem;
5+
margin-bottom: 1.5rem;
6+
7+
.publications__filters-group {
8+
display: flex;
9+
flex-direction: column;
10+
min-width: 140px;
11+
12+
label {
13+
font-size: 0.7rem;
14+
font-weight: 600;
15+
margin-bottom: 0.25rem;
16+
color: $muted-text-color;
17+
}
18+
19+
.publications__filter-select {
20+
font-size: 0.7rem;
21+
padding: 0.25rem 0.4rem;
22+
border-radius: 4px;
23+
border: 1px solid $border-color;
24+
background-color: $background-color;
25+
color: $text-color;
26+
}
27+
}
28+
}
29+
130
.publications__list {
231
list-style-type: none;
332

4-
533
li {
634
margin-bottom: 1.5rem;
735
padding-bottom: 1.5rem;
@@ -26,6 +54,12 @@
2654
margin-bottom: 0.5rem;
2755
}
2856

57+
.pub-topics {
58+
font-size: 0.65rem;
59+
color: $muted-text-color;
60+
margin-bottom: 0.5rem;
61+
}
62+
2963
.pub-venue {
3064
font-size: 0.65rem;
3165
color: $muted-text-color;

assets/js/publications-filters.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
document.addEventListener("DOMContentLoaded", function () {
2+
var venueSelect = document.getElementById("pub-filter-venue");
3+
var yearSelect = document.getElementById("pub-filter-year");
4+
var topicSelect = document.getElementById("pub-filter-topic");
5+
var list = document.getElementById("publications-list");
6+
7+
if (!list || !venueSelect || !yearSelect || !topicSelect) {
8+
return;
9+
}
10+
11+
var items = Array.prototype.slice.call(
12+
list.querySelectorAll(".publications__item")
13+
);
14+
15+
function matchesFilter(item, venue, year, topic) {
16+
var itemVenue = item.getAttribute("data-venue") || "";
17+
var itemYear = item.getAttribute("data-year") || "";
18+
var itemTopics = (item.getAttribute("data-topics") || "").split(",");
19+
20+
if (venue && itemVenue !== venue) {
21+
return false;
22+
}
23+
24+
if (year && itemYear !== year) {
25+
return false;
26+
}
27+
28+
if (topic) {
29+
var hasTopic = itemTopics.some(function (t) {
30+
return t && t.trim() === topic;
31+
});
32+
if (!hasTopic) {
33+
return false;
34+
}
35+
}
36+
37+
return true;
38+
}
39+
40+
function applyFilters() {
41+
var selectedVenue = venueSelect.value;
42+
var selectedYear = yearSelect.value;
43+
var selectedTopic = topicSelect.value;
44+
45+
items.forEach(function (item) {
46+
if (matchesFilter(item, selectedVenue, selectedYear, selectedTopic)) {
47+
item.style.display = "";
48+
} else {
49+
item.style.display = "none";
50+
}
51+
});
52+
}
53+
54+
venueSelect.addEventListener("change", applyFilters);
55+
yearSelect.addEventListener("change", applyFilters);
56+
topicSelect.addEventListener("change", applyFilters);
57+
});
58+
59+

0 commit comments

Comments
 (0)