{%- comment -%} The first section creates an array of page urls that are page urls of this collection. They then are compared to all page urls in the list below. Use group in the frontmatter to group pages. {%- endcomment -%} {%- assign col = site.collections | where: "label", page.collection | first -%} {%- unless site.published == true -%}

{% if site.warning_icon %}{% include_cached icon.html name="info" %} {% endif %}{% if site.warning_message %}{{site.warning_message}}{% else %}This is an unpublished draft preview that might include content that is not yet approved. The published website is at w3.org/WAI/.{% endif %}

{%- endunless -%} {%- if page.parent == '/' -%}{%- assign parent_is_home = true -%}{%- endif -%} {%- if col.parent == '/' -%}{%- assign parent_is_home = true -%}{%- endif -%} {%- if col.parent == '/news/' -%}{%- assign parent_is_home = true -%}{%- endif -%} {%- if parent_is_home -%} {%- assign a_name = "" -%} {%- assign a_url = "" -%} {%- assign b_name = "" -%} {%- assign b_url = "" -%} {%- assign c_name = "" -%} {%- assign c_url = "" -%} {%- assign d_name = "" -%} {%- assign d_url = "" -%} {% else %} {%- if col.parent -%} {%- assign searchurl = col.parent -%} {%- else -%} {%- if page.parent and page.parent != "/" -%} {%- assign searchurl = page.parent -%} {%- else -%} {%- if (page.ref and pagelang) -%} {%- if pagelang != "en" -%} {%- assign searchurl = enpage.url -%} {%- else -%} {%- assign searchurl = page.url -%} {%- endif -%} {%- else -%} {%- assign searchurl = page.url -%} {%- endif -%} {%- endif -%} {%- endif -%} {%- assign search = true -%} {%- for n in site.data.navigation -%} {%- if search == true -%} {%- assign b_name = "" -%} {%- assign b_url = "" -%} {%- assign c_name = "" -%} {%- assign c_url = "" -%} {%- assign d_name = "" -%} {%- assign d_url = "" -%} {%- assign a_name = n.name -%} {%- assign a_url = n.pages[0].url -%} {%- if a_url == searchurl %}{% assign search = false %}{% endif -%} {%- if search == true -%} {%- for n1 in n.pages -%} {%- if search == true -%} {%- assign c_name = "" -%} {%- assign c_url = "" -%} {%- assign d_name = "" -%} {%- assign d_url = "" -%} {%- assign b_name = n1.name -%} {%- assign b_url = n1.url -%} {%- if b_url == searchurl %}{% assign search = false %}{% endif -%} {%- if search == true -%} {%- for n2 in n1.pages -%} {%- if search == true -%} {%- assign d_name = "" -%} {%- assign d_url = "" -%} {%- assign c_name = n2.name -%} {%- assign c_url = n2.url -%} {%- if c_url == searchurl %}{% assign search = false %}{% endif -%} {%- if search == true -%} {%- for n3 in n2.pages -%} {%- if search == true -%} {%- assign d_name = n3.name -%} {%- assign d_url = n3.url -%} {%- if d_url == searchurl %}{% assign search = false %}{% endif -%} {%- endif -%} {%- endfor -%} {%- endif -%} {%- endif -%} {%- endfor -%} {%- endif -%} {%- endif -%} {%- endfor -%} {%- endif -%} {%- endif -%} {%- endfor -%} {%- endif -%} {%- unless page.url == "/" -%} {%- endunless -%}