Skip to content

Commit e10c66e

Browse files
committed
new search
update news also
1 parent 5d4cf5f commit e10c66e

12 files changed

+183
-40
lines changed

_news/2024-09-27-chloe.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
layout: news
3+
title: We welcome Chloe Sheen as a new PhD rotation student in the lab! Welcome Chloe!
4+
---
5+
6+
Check out our <a href="/team">team page</a> for more details.

_news/2024-10-07-adina.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
layout: news
3+
title: We welcome Adina Jailova as a new undergraduate student in the lab to be mentored by Rafael!
4+
---
5+
6+
Check out our <a href="/team">team page</a> for more details.

_news/2024-11-12-duke-upgg.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ layout: news
33
title: Dr. Fan gives an invited talk as part of the Distinguished Lecture Series for the Duke University Genetics & Genomics Program.
44
---
55

6-
Special thanks to Odmaa Bayaraa, Emma Hatchell, Natalie Dzikowski, Anvita Kulshrestha, Ratchanon RP Pornmongkolsuk, and the rest of the UPGG graduate students for inviting and hosting.
6+
Special thanks to Odmaa Bayaraa, Emma Hatchell, Natalie Dzikowski, Anvita Kulshrestha, Ratchanon RP Pornmongkolsuk, and the rest of the UPGG graduate students for inviting and hosting.
7+
8+
<img src="/assets/news/duke_upgg_fall2024-1.jpeg" class="img-responsive">
9+
<img src="/assets/news/duke_upgg_fall2024-2.jpeg" class="img-responsive">

assets/news/duke_upgg_fall2024-1.jpeg

622 KB
Loading

assets/news/duke_upgg_fall2024-2.jpeg

472 KB
Loading

index.html

-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ <h2>We develop methods for analyzing spatially resolved transcriptomic sequencin
4545
<li>
4646
<a href="/publications#/papers/2022/04/29/Miller_et_al-2022-Nature_Communications/">Brendan F Miller, Feiyang Huang, Lyla Atta, Arpan Sahoo, Jean Fan^. Reference-free cell type deconvolution of pixel-resolution spatially resolved transcriptomics data. Nature Communications. 2022. doi:/10.1038/s41467-022-30033-z</a>
4747
</li>
48-
<li>
49-
<a href="/publications#/papers/2021/09/28/Atta_et_al-2021-Bioinformatics/">Lyla Atta, Arpan Sahoo, Jean Fan^. VeloViz: RNA-velocity informed embeddings for visualizing cellular trajectories. Bioinformatics. 2021. /doi:10.1093/bioinformatics/btab653</a>
50-
</li>
5148
<li>
5249
<a href="/publications#/papers/2021/09/06/Atta_et_al-2021-Nature_Communications/">Lyla Atta, Jean Fan^. Computational challenges and opportunities in spatially resolved transcriptomic data analysis. Nature Communications. 2021. doi:10.1038/s41467-021-25557-9</a>
5350
</li>

js/lunr.min.js

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/search.js

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// https://learn.cloudcannon.com/jekyll/jekyll-search-using-lunr-js/
2+
(function() {
3+
function displaySearchResults(results, store) {
4+
//console.log('Displaying search results...')
5+
var searchResults = document.getElementById('search-box-results');
6+
searchResults.innerHTML = ''; // Clear old results
7+
8+
if (results.length) { // Are there any results?
9+
var appendString = '';
10+
11+
for (var i = 0; i < results.length; i++) { // Iterate over the results
12+
var item = store[results[i].ref];
13+
appendString += '<li><a href="' + item.url + '">' + item.title + '</a> - <i>' + item.content.substring(0, 150) + '...(continue reading)</i></li>';
14+
}
15+
16+
searchResults.innerHTML = appendString;
17+
} else {
18+
searchResults.innerHTML = '<li>No results found</li>';
19+
}
20+
}
21+
22+
function debounce(func, delay) {
23+
let timeout;
24+
return function (...args) {
25+
clearTimeout(timeout);
26+
timeout = setTimeout(() => func.apply(this, args), delay);
27+
};
28+
}
29+
30+
// Listen for input events in the search box
31+
var searchBox = document.getElementById('search-box');
32+
searchBox.addEventListener('input', (event) => {
33+
//console.log("Handling search for: ", event.target.value);
34+
handleSearch(event.target.value);
35+
});
36+
37+
// Prevent form submission on Enter key press
38+
var searchForm = document.getElementById('search-form');
39+
searchForm.addEventListener('submit', (event) => {
40+
event.preventDefault(); // Prevent the page from refreshing
41+
//console.log("Form submitted, but default action prevented.");
42+
});
43+
44+
// Initalize lunr with the fields it will be searching on. I've given title
45+
// a boost of 10 to indicate matches on this field are more important.
46+
var idx = lunr(function () {
47+
this.field('id');
48+
this.field('title', { boost: 10 });
49+
this.field('author');
50+
this.field('tags', { boost: 5 });
51+
this.field('content');
52+
});
53+
54+
for (var key in window.store) { // Add the data to lunr
55+
idx.add({
56+
'id': key,
57+
'title': window.store[key].title,
58+
'author': window.store[key].author,
59+
'tags': window.store[key].tags,
60+
'content': window.store[key].content
61+
});
62+
}
63+
64+
65+
var handleSearch = debounce((query) => {
66+
var searchTerm = query;
67+
//console.log("Searching for:", searchTerm);
68+
69+
var results = idx.search(searchTerm); // Get lunr to perform a search
70+
displaySearchResults(results, window.store); // We'll write this in the next section
71+
}, 300); // 300ms delay
72+
73+
})();

0 commit comments

Comments
 (0)