Skip to content

Latest commit

 

History

History
60 lines (53 loc) · 1.62 KB

File metadata and controls

60 lines (53 loc) · 1.62 KB
layout default
title Projects
permalink /projects/

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 -%}

  • All
  • {%- for tag in all_tags -%} {%- if tag != "" -%}
  • {{ tag }}
  • {%- endif -%} {%- endfor -%}
{% 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>