updated menu

This commit is contained in:
Benjamin Jones 2020-08-16 11:52:49 +02:00
parent a5e1be9465
commit 245112c463
4 changed files with 89 additions and 40 deletions

View File

@ -1,19 +1,49 @@
- about:
en:
name: call for participants
name: about
url: /about
fr:
name: à propos
url: /a-propos
- participate:
- conference:
en:
name: submit a proposal
url: "/how-to-participate"
name: ReclimFutures conference 2020
fr:
name: soumettre une proposition
url: /participer
name: ReclimFutures conference 2020
items:
- program:
en:
name: program
url: "/rf2020/program"
fr:
name: programme
url: /rf2020/programme
- participants:
en:
name: participants
url: "/rf2020/participants"
fr:
name: participants
url: /rf2020/participants
- donate:
colour: red
en:
name: donate
url: "/donate"
fr:
name: faire un don
url: /donate
# - participate:
# en:
# name: submit a proposal
# url: "/how-to-participate"
# fr:
# name: soumettre une proposition
# url: /participer
# - attend:
# en:

View File

@ -19,6 +19,7 @@
<link rel="icon" type="image/png" sizes="16x16" href="{{ site.baseurl }}/assets/favicons/favicon-16x16.png">
<link rel="apple-touch-icon" sizes="180x180" href="{{ site.baseurl }}/assets/favicons/apple-touch-icon.png">
<link rel="manifest" href="{{ site.baseurl }}/assets/favicons/site.webmanifest">
<link rel="icon" href="{{ site.baseurl }}/assets/favicons/svg-favi.svg">
<link rel="mask-icon" href="{{ site.baseurl }}/assets/favicons/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#0ddfe7">

View File

@ -1,38 +1,39 @@
{% assign posts=site.posts | where:"ref", page.ref | sort: 'lang' %}
{% assign newpages=site.pages | where:"ref", page.ref | sort: 'lang' %}
<div class="nav-group">
{% if posts.size > 1 %}
{% for post in posts %}
{% if post.lang != page.lang %}
<a href="{{ site.base-url }}{{ post.url }}" class="lang lang--{{ page.lang }}">
{% if page.lang == 'en' %}
{{ include.fr-text }}
{% else %}
{{ include.en-text }}
{% endif %}
</a>
{% endif %}
{% endfor %}
{% if posts.size > 1 %}
{% for post in posts %}
{% if post.lang != page.lang %}
<a href="{{ site.base-url }}{{ post.url }}" class="lang lang--{{ page.lang }}">
{% if page.lang == 'en' %}
{{ include.fr-text }}
{% else %}
{{ include.en-text }}
{% endif %}
</a>
{% endif %}
{% endfor %}
{% elsif newpages.size > 1 %}
{% for pege in newpages %}
{% if pege.lang != page.lang and page.ref != '' %}
{% if page.lang == 'en' %}
<a href="{{ pege.url }}" class="lang lang--{{ page.lang }}">{{ include.fr-text }}</a>
{% else %}
<a href="{{ pege.url }}" class="lang lang--{{ page.lang }}">{{ include.en-text }} </a>
{% endif %}
{% endif %}
{% endfor %}
{% elsif newpages.size > 1 %}
{% for pege in newpages %}
{% if pege.lang != page.lang and page.ref != '' %}
{% if page.lang == 'en' %}
<a href="{{ pege.url }}" class="lang lang--{{ page.lang }}">{{ include.fr-text }}</a>
{% else %}
<a href="{{ pege.url }}" class="lang lang--{{ page.lang }}">{{ include.en-text }} </a>
{% endif %}
{% endif %}
{% endfor %}
{% elsif page.lang == 'en' %}
<a href="{{ site.baseurl }}/fr" class="lang lang--{{ page.lang }}">{{ include.fr-text }}</a>
<span class="poop">{{ site.data.menu[page.ref]}}</span>
{% else %}
<a href="{{ site.baseurl }}/" class="lang lang--{{ page.lang }}">{{ include.en-text }} </a>
<span class="poop">{{ site.data.menu[page.ref]}}</span>
{% endif %}
{% elsif page.lang == 'en' %}
<a href="{{ site.baseurl }}/fr" class="lang lang--{{ page.lang }}">{{ include.fr-text }}</a>
<span class="poop">{{ site.data.menu[page.ref]}}</span>
{% else %}
<a href="{{ site.baseurl }}/" class="lang lang--{{ page.lang }}">{{ include.en-text }} </a>
<span class="poop">{{ site.data.menu[page.ref]}}</span>
{% endif %}
</div>

View File

@ -2,13 +2,30 @@
<nav>
<div class="menu">
{% for item in site.data.menu %}
{% if page.lang == 'en' %}
<a class="nav-link" href="{{ site.baseurl | append: item[page.lang].url }}">{{ item[page.lang].name }}</a>
{% if item.items %}
<div class="nav-group">
<a class="nav-link">{{ item[page.lang].name }}</a>
{% for sublink in item.items %}
{% if page.lang == 'en' %}
<a class="sub-nav-link" href="{{ site.baseurl | append: sublink[page.lang].url }}" style=" color: {{ sublink.colour }}">{{ sublink[page.lang].name }}</a>
{% else %}
<a class="sub-nav-link" href="{{ site.baseurl }}/{{ page.lang | append: sublink[page.lang].url }}">{{ sublink[page.lang].name }}</a>
{% endif %}
{% endfor %}
</div>
{% else %}
<a class="nav-link" href="{{ site.baseurl }}/{{ page.lang | append: item[page.lang].url }}">{{ item[page.lang].name }}</a>
{% if page.lang == 'en' %}
<div class="nav-group">
<a class="nav-link" href="{{ site.baseurl | append: item[page.lang].url }}">{{ item[page.lang].name }}</a>
</div>
{% else %}
<div class="nav-group">
<a class="nav-link" href="{{ site.baseurl }}/{{ page.lang | append: item[page.lang].url }}">{{ item[page.lang].name }}</a>
</div>
{% endif %}
{% endif %}
{% endfor %}
</div>
{% include common/lang-selector.html en-text="/english" fr-text="/français" %}
</div>
</nav>