{%- if page.parent == "/" -%} {%- assign searchurl = page.parent -%} {%- else -%} {%- if page.ref and page.lang -%} {%- if page.lang != "en" -%} {%- assign searchurl = enpage.url -%} {%- else -%} {%- assign searchurl = page.url -%} {%- endif -%} {%- else -%} {%- assign searchurl = page.url -%} {%- endif -%} {%- endif -%} {%- if col.navigation -%} {%- assign currentsubnav = col.navigation -%} {%- else -%} {%- for item in site.data.navigation -%} {%- for i in item.pages -%} {%- if i.url == searchurl -%} {%- assign currentsubnav = item -%} {%- else -%} {%- for j in i.pages -%} {%- if j.url == searchurl -%} {%- assign currentsubnav = item -%} {%- else -%} {%- for k in j.pages -%} {%- if k.url == searchurl -%} {%- assign currentsubnav = item -%} {%- endif -%} {%- endfor -%} {%- endif -%} {%- endfor -%} {%- endif -%} {%- endfor -%} {%- endfor -%} {%- endif -%}