This commit is contained in:
2024-06-18 17:10:31 +01:00
commit 694571a3db
54 changed files with 2765 additions and 0 deletions

17
public/js/search.js Normal file
View File

@@ -0,0 +1,17 @@
function filterArticles() {
const tagSelect = document.getElementById('tag-select');
const selectedTag = tagSelect.value;
const articles = document.querySelectorAll('.article');
articles.forEach(article => {
const tags = article.getAttribute('data-tags').split(' ');
if (selectedTag === 'all' || tags.includes(selectedTag)) {
article.style.display = 'flex';
} else {
article.style.display = 'none';
}
});
}
// Initial call to display all articles
filterArticles();