Skip to content

Commit

Permalink
[#220] Make Deployments section conditional on having content in lang
Browse files Browse the repository at this point in the history
This will hide the section for Japanese documentation until there is
a translation available.

- See #651 (comment)
  • Loading branch information
mwbrooks committed Oct 2, 2020
1 parent f628553 commit cef89ab
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions docs/_includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,19 @@
</ul>
<!--End (temporary) beta sections-->

<ul class="sidebar-section">
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/deployments">
<li class="title">{{ site.t[page.lang].deployments }}</li>
</a>
{% assign deployments_sections = site.deployments | sort: "order" | where: "lang", page.lang %}
{% for section in deployments_sections %}
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/deployments/{{ section.slug }}">
<li>{{section.title}}</li>
{% assign deployments_sections = site.deployments | sort: "order" | where: "lang", page.lang %}
{% if deployments_sections.size > 0 %}
<ul class="sidebar-section">
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/deployments">
<li class="title">{{ site.t[page.lang].deployments }}</li>
</a>
{% endfor %}
</ul>
{% for section in deployments_sections %}
<a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/deployments/{{ section.slug }}">
<li>{{section.title}}</li>
</a>
{% endfor %}
</ul>
{% endif %}

<ul class="sidebar-section">
{% assign tutorials = site.tutorials | where: "lang", page.lang | where_exp: "tutorial", "tutorial.order > 0" %}
Expand Down

0 comments on commit cef89ab

Please sign in to comment.