{%- include languages/languages.html -%} {%- if page.permalink == nil -%} {%- for i in matchurls -%} {%- for checklang in site.pages -%} {%- if checklang.permalink == i -%} {%- assign languagetext = [i] -%} {%- endif -%} {%- endfor -%} {%- endfor -%} {%- else -%} {%- if matchurls contains page.permalink -%} {%- assign languagetext = [i] -%} {%- for i in matchurls -%} {%- assign languagetext = [i] -%} {%- if i== page.permalink -%} {%- else -%} {%- for checklang in site.pages -%} {%- if checklang.permalink == i -%} {%- assign languagetext = [i] -%} {%- endif -%} {%- endfor -%} {%- endif -%} {%- endfor -%} {%- else -%} {%- for item in site.pages -%} {%- assign languagetext = [item.lang] -%} {%- assign pagelink = page.permalink | split: "/" | last-%} {%- assign itemlink = item.permalink | split: "/" | last-%} {% if pagelink == itemlink and page.lang != item.lang and page.permalink != item.permalink %} {% assign whitelist_urls = site.data.noindexURLs.internatlionalization_whitelist_urls %} {% if whitelist_urls %} {% assign exclude_url = false %} {% for url in whitelist_urls %} {% assign current_url = url | strip %} {% if current_url == item.permalink %} {% assign exclude_url = true %} {% endif %} {% endfor %} {% if exclude_url %} {% endif %} {% endif %} {% endif %} {%- if pagelink == itemlink and page.lang == item.lang -%} {% assign whitelist_urls = site.data.noindexURLs.internatlionalization_whitelist_urls %} {% assign noindex_languages = site.data.noindexURLs.noindex_languages %} {% if noindex_languages contains languagetext[0] %} {%- if whitelist_urls -%} {% assign exclude_url = false %} {% for url in whitelist_urls %} {% assign current_url = url | strip %} {% if current_url == item.permalink %} {%- assign exclude_url = true -%} {% endif %} {% endfor %} {%- if exclude_url -%} {%- endif -%} {%- endif -%} {%- else -%} {% assign final_permalink = item.permalink %} {% if item.permalink contains '/' %} {% else %} {% assign final_permalink = '/' | append: item.permalink %} {% endif %} {% assign blacklist_urls = site.data.noindexURLs.blacklist_urls %} {%- if blacklist_urls contains final_permalink -%} {%- else -%} {%- endif -%} {%- endif -%} {%- endif -%} {%- endfor -%} {%- endif -%} {%- endif -%}