Skip to content
This repository has been archived by the owner on May 29, 2021. It is now read-only.

Commit

Permalink
Make site backwards compatible with nav listing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremia Kimelman committed Feb 12, 2016
1 parent a80c13a commit 431b85d
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions _navigation.json
Expand Up @@ -2,31 +2,19 @@
---

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

{% for page in site.pages %}

{% if nav.permalink == page.permalink %}
{% assign href = page.path %}
{% endif %}
{% endfor %}
"href": "{{ href }}"
"href": "{{ nav.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 }}"
"title": "{{ child.text }}",
"permalink": "{{ child.permalink }}",
"href": "{{ child.href }}"

} {% if forloop.rindex != 1 %}, {% endif %}
{% endfor %}
Expand All @@ -35,10 +23,6 @@

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

0 comments on commit 431b85d

Please sign in to comment.