{% comment %} Here, we loop through site.data for the current view to set two variables: 1. this_pages_navbar - a object containing this page's navbar 2. navbars - a list of this site's toplevel navbars sorted by navbar.order The code is a little roundabout for a few reasons: - liquid doesn't provide a simple way to create an empty array, so we just split an empty string. - liquid stores the navbars (in site.data[version].navbars) as a list keyed by the filename. We don't really care about the filename here, so we just need the data field. But, liquid doesn't provide a simple way to 'iteritems', so we have to manually loop through and access the 2nd item. - liquid also has a bug where it truncates after first `.` of a directory name in _data (i.e. _data/v0.1 will be stored as data.v0). Until that bug's fixed, we store version data in _data/v0_1 and do a string replace to find the right data. {% endcomment %} {% assign current_page = page.path | replace_first: page.version,"" | split: "/" %} {% assign current_page = current_page[1] | prepend: "/" %} {% capture version %}{{ page.version | replace: ".","_" }}{% endcapture %} {% assign unsorted_navbars = "" | split:"|" %} {% for navbars_hashmap in site.data[version].navbars %} {% assign navbar = navbars_hashmap[1] %} {% assign unsorted_navbars = unsorted_navbars | push: navbar %} {% assign navbar_size = navbar.path | size %} {% if current_page == navbar.path %} {% assign this_pages_navbar = navbar %} {% endif %} {% endfor %} {% assign navbars = unsorted_navbars | sort:"order" %} {% if page.version != "v1.5" and page.version != "v1.6" and page.version != "v2.0" and page.version != "v2.1" and page.version != "v2.2" and page.version != "v2.3" and page.version != "v2.4" and page.version != "v2.5" and page.version != "v2.6" and page.version != "v3.0" and page.version != "v3.1" and page.version != "v3.2" and page.version != "v3.3" %} {% endif %} {% seo %}

{% include version_warning.html %}

{{ page.title }}

{{ content }}