Skip to content

Commit

Permalink
🏗️ More explanations for i18n system (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
xplosionmind committed Jul 19, 2024
1 parent 033a660 commit 3cf9304
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ournet/_layouts/base.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
1 change: 1 addition & 0 deletions ournet/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: 🪡 Knitting Our Internet 🧶
reference_page: index
---

<figure>
Expand Down
1 change: 1 addition & 0 deletions ournet/it/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: 🪡 La Nostra Rete 🧶
reference_page: index
---
<figure>
<img src='{{ site.image }}' alt='Un gruppo di persone sedute in cerchio, connesse da un filo rosso'>
Expand Down

0 comments on commit 3cf9304

Please sign in to comment.