| layout | default |
|---|---|
| title | Projects |
| permalink | /projects/ |
{%- assign all_tags = "" -%} {%- for p in site.project -%} {%- if p.tags -%} {%- for t in p.tags -%} {%- assign all_tags = all_tags | append: t | append: "," -%} {%- endfor -%} {%- endif -%} {%- endfor -%} {%- assign all_tags = all_tags | split: "," | uniq | sort -%}
{% assign sorted_projects = site.project | sort: "date" | reverse %}
{% for project in sorted_projects %}
{% include projecttile.html item=project %}
{% endfor %}
<script>
(function () {
const buttons = document.querySelectorAll(".tag-filter");
const cards = document.querySelectorAll(".project-tile");
buttons.forEach((btn) => {
btn.addEventListener("click", (e) => {
e.preventDefault();
buttons.forEach((b) => b.classList.remove("active"));
btn.classList.add("active");
const tag = btn.dataset.tag;
cards.forEach((card) => {
const tags = card.dataset.tags ? card.dataset.tags.split(",") : [];
const match = tag === "all" || tags.includes(tag);
card.style.display = match ? "" : "none";
});
});
});
})();
</script>