Skip to content

Commit fe1f575

Browse files
committed
Introduce i18n for site navigation
1 parent 1d3e4b0 commit fe1f575

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

_config.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,20 @@ credits:
109109
Puoi contattare il nostro <a href="mailto:[email protected]">webmaster</a>
110110
per domande e commenti riguardanti questo sito.
111111

112+
nav:
113+
en:
114+
- name: Downloads
115+
url: downloads
116+
- name: Documentation
117+
url: documentation
118+
- name: Libraries
119+
url: libraries
120+
- name: Community
121+
url: community
122+
- name: News
123+
url: news
124+
- name: Security
125+
url: security
126+
- name: About Ruby
127+
url: about
128+

_includes/sitelinks.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
<a href="/{{ page.lang }}/downloads/">Downloads</a><span class="separator"> | </span><a href="/{{ page.lang }}/documentation/">Documentation</a><span class="separator"> | </span><a href="/{{ page.lang }}/libraries/">Libraries</a><span class="separator"> | </span><a href="/{{ page.lang }}/community/">Community</a><span class="separator"> | </span><a href="/{{ page.lang }}/news/">News</a><span class="separator"> | </span><a href="/{{ page.lang }}/security/">Security</a><span class="separator"> | </span><a href="/{{ page.lang }}/about/">About Ruby</a>
1+
{% if site.nav[page.lang] %}
2+
{% assign navlang = page.lang %}
3+
{% else %}
4+
{% assign navlang = 'en' %}
5+
{% endif %}
6+
{% for link in site.nav[navlang] %}
7+
<a href="/{{ page.lang }}/{{ link.url }}/">{{ link.name }}</a>{% unless forloop.last %}<span class="separator"> | </span>{% endunless %}
8+
{% endfor %}

0 commit comments

Comments
 (0)