diff --git a/ournet/_layouts/base.liquid b/ournet/_layouts/base.liquid index 47d0321..5abb377 100644 --- a/ournet/_layouts/base.liquid +++ b/ournet/_layouts/base.liquid @@ -5,11 +5,11 @@ prefix='og: http://ogp.me/ns#' > - {% if ref %} - {% assign alternates = '' | split: '/' %} - {% for entry in collections.all %} - {% if entry.data.ref == ref and entry.data.lang != lang %} - {% assign alternates = alternates | concat: entry %} + {% if reference_page %}{% comment %}If the page has the reference_page value, it means that it has a translation, or that it is the translation of another page{% endcomment %} + {% assign alternates = '' | split: '/' %}{% comment %}Creating an empty array{% endcomment %} + {% for entry in collections.all %}{% comment %}Loop through all pages of the website{% endcomment %} + {% if entry.data.reference_page == reference_page and entry.data.lang != lang %}{% comment %}Check if the entry has the same reference_page value of the current page, and if it has a different language{% endcomment %} + {% assign alternates = alternates | concat: entry %}{% comment %}If previous conditions apply, add the entry to the array of alternates of this page{% endcomment %} {% endif %} {% endfor %} {% endif %} diff --git a/ournet/index.md b/ournet/index.md index 1aa5080..b18c9b6 100644 --- a/ournet/index.md +++ b/ournet/index.md @@ -1,5 +1,6 @@ --- title: 🪡 Knitting Our Internet 🧶 +reference_page: index ---
diff --git a/ournet/it/index.md b/ournet/it/index.md index ee9f86b..69a6191 100644 --- a/ournet/it/index.md +++ b/ournet/it/index.md @@ -1,5 +1,6 @@ --- title: 🪡 La Nostra Rete 🧶 +reference_page: index ---
Un gruppo di persone sedute in cerchio, connesse da un filo rosso