---
---

[
  {% for nav in site.data.navbar %}
  {
    "title": "{{ nav.name }}",
    "permalink": "{{ nav.permalink }}",

    {% for page in site.pages %}

      {% if nav.permalink == page.permalink %}
       {% assign href = page.path %}
      {% endif %}
    {% endfor %}
    "href": "{{ href }}"

    {% if nav.children %},
    "children": [
      {% for child in nav.children %}
      {
        "title": "{{ child.name }}",
        "permalink": "{{ nav.permalink }}",
        {% for p in site.pages %}
          {% if child.permalink == p.permalink %}
            {% assign childHref = p.path %}
          {% endif %}
        {% endfor %}
        "href": "{{ childHref }}"

      } {% if forloop.rindex != 1 %}, {% endif %}
      {% endfor %}
    ]
    {% endif %}

  },
  {% endfor %}
  {
    "title": "Project data",
    "href": "_data/projects.yml"
  },
  {
    "title": "Navigation bar data",
    "href": "_data/navbar.yml"
  }
]

---
---

[
  {% for nav in site.data.navbar.assigned %}
  {
    "title": "{{ nav.text }}",
    "permalink": "{{ nav.permalink }}",
    "href": "{{ nav.href }}"

    {% if nav.children %},
    "children": [
      {% for child in nav.children %}
      {
        "title": "{{ child.text }}",
        "permalink": "{{ child.permalink }}",
        "href": "{{ child.href }}"

      } {% if forloop.rindex != 1 %}, {% endif %}
      {% endfor %}
    ]
    {% endif %}

  },
  {% endfor %}
  {
    "title": "Navigation bar data",
    "href": "_data/navbar.yml"
  }
]

Make site backwards compatible with nav listing
Make site backwards compatible with nav listing
