Switched to Jinja's safer string concatenation operator

This commit is contained in:
squidfunk 2020-11-08 11:13:02 +01:00
parent bca3240007
commit 86a4c47c0a
6 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
{#-
This file was automatically generated - do not edit
-#}
{% import "partials/language/" + config.theme.language + ".html" as lang %}
{% import "partials/language/" ~ config.theme.language ~ ".html" as lang %}
{% import "partials/language/en.html" as fallback %}
{% macro t(key) %}{{ lang.t(key) or fallback.t(key) }}{% endmacro %}

View File

@ -21,7 +21,7 @@
<ul class="md-nav__list" data-md-scrollfix>
{% set base = path %}
{% for nav_item in nav_item.children %}
{% set path = base + "-" + loop.index | string %}
{% set path = base ~ "-" ~ loop.index %}
{% set level = level + 1 %}
{% include "partials/nav-item.html" %}
{% endfor %}

View File

@ -19,7 +19,7 @@
{% endif %}
<ul class="md-nav__list" data-md-scrollfix>
{% for nav_item in nav %}
{% set path = "nav-" + loop.index | string %}
{% set path = "nav-" ~ loop.index %}
{% set level = 1 %}
{% include "partials/nav-item.html" %}
{% endfor %}

View File

@ -21,7 +21,7 @@
-->
<!-- Import translations for given language and fallback -->
{% import "partials/language/" + config.theme.language + ".html" as lang %}
{% import "partials/language/" ~ config.theme.language ~ ".html" as lang %}
{% import "partials/language/en.html" as fallback %}
<!-- Re-export translations -->

View File

@ -59,7 +59,7 @@
<!-- Render nested item list -->
{% set base = path %}
{% for nav_item in nav_item.children %}
{% set path = base + "-" + loop.index | string %}
{% set path = base ~ "-" ~ loop.index %}
{% set level = level + 1 %}
{% include "partials/nav-item.html" %}
{% endfor %}

View File

@ -56,7 +56,7 @@
<!-- Render item list -->
<ul class="md-nav__list" data-md-scrollfix>
{% for nav_item in nav %}
{% set path = "nav-" + loop.index | string %}
{% set path = "nav-" ~ loop.index %}
{% set level = 1 %}
{% include "partials/nav-item.html" %}
{% endfor %}