Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(translations): add menuitems translations #703

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions templates/_includes/_defaults.html
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,21 @@
{% else %}
{% set SHARE_LINKS = SHARE_LINKS %}
{% endif %}


{% if not HOME_MENUITEM %}
{% set HOME_MENUITEM = 'Home' %}
{% else %}
{% set HOME_MENUITEM = HOME_MENUITEM %}
{% endif %}


{% if not MENUITEMS %}
{% set MENUITEMS = (
('categories', 'Categories', CATEGORIES_URL),
('tags', 'Tags', TAGS_URL),
('archives', 'Archives', ARCHIVES_URL),
) %}
{% else %}
{% set MENUITEMS = MENUITEMS %}
{% endif %}
11 changes: 6 additions & 5 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,25 @@
<a class="brand" href="{{ SITEURL }}/"><span class=site-name>{{ SITENAME }}</span></a>
<div class="nav-collapse collapse">
<ul class="nav pull-right top-menu">
{% from '_includes/_defaults.html' import HOME_MENUITEM with context %}
<li {% if page_name == 'index' %} class="active"{% endif %}>
<a href=
{% if SITEURL %}
{{ SITEURL }}
{% else %}
"/"
{% endif %}
>Home</a>
>{{ HOME_MENUITEM }}</a>
</li>
{% if DISPLAY_PAGES_ON_MENU %}
{% for p in pages %}
<li {% if p == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
{% endfor %}
{% endif %}
{% from '_includes/_defaults.html' import TAGS_URL, CATEGORIES_URL, ARCHIVES_URL, SEARCH_URL with context %}
<li {% if page_name == 'categories' %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ CATEGORIES_URL }}">Categories</a></li>
<li {% if page_name == 'tags' %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ TAGS_URL }}">Tags</a></li>
<li {% if page_name == 'archives' %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ ARCHIVES_URL }}">Archives</a></li>
{% from '_includes/_defaults.html' import MENUITEMS with context %}
{% for name, title, link in MENUITEMS %}
<li {% if page_name == name %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ link }}">{{ title }}</a></li>
{% endfor %}
<li><form class="navbar-search" action="{{ SITEURL }}/{{ SEARCH_URL }}" onsubmit="return validateForm(this.elements['q'].value);"> <input type="text" class="search-query" placeholder="Search" name="q" id="tipue_search_input"></form></li>
</ul>
</div>
Expand Down