_includes/alternates/alternates.html in word-games-theme-2.9.7 vs _includes/alternates/alternates.html in word-games-theme-2.9.8

- old
+ new

@@ -5,12 +5,13 @@ {%- for checklang in site.pages -%} {%- if checklang.permalink == i -%} {%- assign languagetext = [i] -%} -{% assign whitelist_urls = site.whitelist_urls %} -{% if site.noindex_languages contains languagetext[0] %} +{% 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 -%} {% for url in whitelist_urls %} {% assign current_url = url | remove_first: '/' | strip %} {% assign language_url = languagetext[0] | strip %} {% if current_url == language_url %} @@ -37,12 +38,13 @@ <link data-rh="true" rel="alternate" href="{{site.url}}" hreflang="en" /> {%- for i in matchurls -%} {%- assign languagetext = [i] -%} {%- if i== page.permalink -%} -{% assign whitelist_urls = site.whitelist_urls %} -{% if site.noindex_languages contains languagetext[0] %} +{% 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 -%} {% for url in whitelist_urls %} {% assign current_url = url | remove_first: '/' | strip %} {% assign language_url = languagetext[0] | strip %} {% if current_url == language_url %} @@ -62,11 +64,12 @@ {%- for checklang in site.pages -%} {%- if checklang.permalink == i -%} {%- assign languagetext = [i] -%} -{% if site.noindex_languages contains languagetext[0] %} +{% assign noindex_languages = site.data.noindexURLs.noindex_languages %} +{% if noindex_languages contains languagetext[0] %} {%- if whitelist_urls -%} {% for url in whitelist_urls %} {% assign current_url = url | remove_first: '/' | strip %} {% assign language_url = languagetext[0] | strip %} {% if current_url == language_url %} @@ -88,11 +91,12 @@ {%- 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 -%} -{% if site.noindex_languages contains languagetext[0] %} +{% assign noindex_languages = site.data.noindexURLs.noindex_languages %} +{% if noindex_languages contains languagetext[0] %} {%- if whitelist_urls -%} {% for url in whitelist_urls %} {% assign current_url = url | strip %} {% if current_url == item.permalink %} <link data-rh="true" rel="alternate" href="{{site.url}}{{item.permalink}}" hreflang="{{languagetext[0]}}" /> @@ -104,12 +108,14 @@ {%- endif -%} {%- endif -%} {%- if pagelink == itemlink and page.lang == item.lang -%} -{% assign whitelist_urls = site.whitelist_urls %} -{% if site.noindex_languages contains languagetext[0] %} + +{% 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 -%} {% for url in whitelist_urls %} {% assign current_url = url | strip %} {% if current_url == item.permalink %} {%- assign exclude_url = true -%} @@ -126,10 +132,12 @@ {% if item.permalink contains '/' %} {% else %} {% assign final_permalink = '/' | append: item.permalink %} {% endif %} -{%- if site.blacklist_urls contains final_permalink -%} + +{% assign blacklist_urls = site.data.noindexURLs.blacklist_urls %} +{%- if blacklist_urls contains final_permalink -%} {%- else -%} <link data-rh="true" rel="alternate" href="{{ site.url }}{{final_permalink}}" hreflang="{{ languagetext[0] }}" /> {%- endif -%} \ No newline at end of file