Skip to content

Commit

Permalink
chore: Ignore Nunjucks whitespace control
Browse files Browse the repository at this point in the history
  • Loading branch information
mvsde committed Mar 27, 2019
1 parent a1ce450 commit 0f53667
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions ui/templates/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script defer src="{% static 'pangolin/scripts.js' %}"></script>
<link rel="stylesheet" href="{% static 'pangolin/styles.css' %}">

{% if project.branding -%}
{% if project.branding %}
<style>
:root {
{% if project.branding.colorTheme %}
Expand All @@ -29,7 +29,7 @@
{% endif %}
}
</style>
{%- endif %}
{% endif %}
</head>
<body>

Expand Down
18 changes: 9 additions & 9 deletions ui/templates/nav.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro link (path, text) %}
<a
{%- if path == page.path %} aria-current="page"{% endif %}
{% if path == page.path %} aria-current="page"{% endif %}
class="nav__text nav__text--link {% if path == page.path %}is-active js-nav-active{% endif %}"
href="{% static path %}.html"
>
Expand All @@ -11,29 +11,29 @@
{% macro nav (items, depth = 0) %}
{% set depth = depth + 1 %}
<ul class="nav__list">
{% for item in items -%}
{% for item in items %}

<li
class="nav__item"
style="--depth:{{ depth }};"
>

{%- if item.path -%}
{% if item.path %}
{{ link(item.path, item.name) }}
{%- endif -%}
{% endif %}

{%- set children = item.children -%}
{% set children = item.children %}

{%- if (children | length == 1) and children[0].path -%}
{% if (children | length == 1) and children[0].path %}
{{ link(children[0].path, children[0].name) }}
{%- elseif children -%}
{% elseif children %}
<span class="nav__text nav__text--title">{{ item.name }}</span>
{{ nav(children, depth) }}
{%- endif -%}
{% endif %}

</li>

{%- endfor %}
{% endfor %}
</ul>
{% endmacro %}

Expand Down

0 comments on commit 0f53667

Please sign in to comment.