let navItems = [
  {
    "href": "/",
    "title": "home"
  },
  {
    "href": "/signup",
    "title": "get involved"
  },
  {
    "href": "/zines",
    "title": "zines!"
  },
  {
    "href": "/years",
    "title": "all years"
  }
]

function populateNav() {
  let nav = document.getElementById("top-nav");
  let path = window.location.pathname;
  
  for (let i = 0; i < navItems.length; i++) {
    if (navItems[i].href == path) {
      continue;
    }
    
    let a = document.createElement("a");
    a.classList.add("nav-item");
    a.href = navItems[i].href;
    a.innerHTML = " " + navItems[i].title + " ";
    
    nav.append(a);
  }
}

populateNav();
