mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 09:46:12 +00:00
Use modulo instead of cycle to split language menu
This commit is contained in:
parent
0efc267ca3
commit
2b5ac2b0f2
1 changed files with 5 additions and 3 deletions
|
@ -39,11 +39,13 @@ if(typeof(legacyIE)==='undefined'){
|
|||
<ul class="lang">
|
||||
<li><a href="#" onclick="return false;">{{ site.langs[page.lang] }}</a>
|
||||
<ul>
|
||||
<li><ul>
|
||||
{% assign i == 0 %}
|
||||
{% for lang in site.langsorder %}{% assign active = ''%}{% if lang == page.lang %}{% assign active = ' class="active"'%}{% endif %}
|
||||
{% cycle 'start': '<li><ul>', '', '', '', '', '', '', '', '', '', '' %}
|
||||
{% assign m = i | modulo:11 %}{% assign i = i | plus:1 %}{% if m == 0 and i != 1 %}</li></ul><li><ul>{% endif %}
|
||||
<li><a href="/{{ lang }}/{% translate {{page.id}} url {{lang}} %}"{{ active }}>{{ site.langs[lang] }}</a></li>
|
||||
{% cycle 'end': '', '', '', '', '', '', '', '', '', '', '</ul></li>' %}{% endfor %}
|
||||
{% cycle 'end': '', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>', '</ul></li>' %}
|
||||
{% endfor %}
|
||||
</ul></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue