diff --git a/src/templates/cluster.html b/src/templates/cluster.html index 2d365d8..779bf4a 100644 --- a/src/templates/cluster.html +++ b/src/templates/cluster.html @@ -24,7 +24,7 @@ {%- elif this.group_key == 'time' -%} {{ attrib | durationCluster(this.xdata, this.alt) }} {%- elif this.group_key == 'difficulty' -%} - {{ localize(this.alt, 'difficulty', attrib) }} + {{ bag('i18n+' + this.alt, 'difficulty', attrib) }} {%- else -%} {{ attrib }} {%- endif -%} diff --git a/src/templates/layout.html b/src/templates/layout.html index 7dcc627..73e8280 100644 --- a/src/templates/layout.html +++ b/src/templates/layout.html @@ -15,10 +15,15 @@ @@ -38,7 +43,9 @@ {#--#} {#--#}
Build with Lektor, template by relikd. - (PDF) + {#--#} + (PDF){#--#} + {%- set url_without_alt = ('.'|url(absolute=True))[4:] -%} {%- if this.alt == 'de' -%} πŸ‡ΊπŸ‡Έ diff --git a/src/templates/recipe.html b/src/templates/recipe.html index 214206a..02cfee3 100644 --- a/src/templates/recipe.html +++ b/src/templates/recipe.html @@ -24,18 +24,15 @@
{{ this.rating|rating }}
- {%- if this.difficulty %} - {{ localize(this.alt, 'difficulty', this.difficulty) }} - {%- else %} - {{ localize(this.alt, 'difficulty._unset') }} - {%- endif %} + {{ + bag('i18n+' + this.alt, 'difficulty', this.difficulty or '_unset') }}
-
{{ localize(this.alt, 'duration.label') }}: {{ this.time|duration(this.alt) if this.time else 'β€”' }}
-
{{ localize(this.alt, 'yield.label') }}: {{ this.yield or 'β€”' }}
+
{{ bag('i18n+' + this.alt, 'duration.label') }}: {{ this.time|duration(this.alt) if this.time else 'β€”' }}
+
{{ bag('i18n+' + this.alt, 'yield.label') }}: {{ this.yield or 'β€”' }}
-

{{ localize(this.alt, 'title.ingredients') }}:

+

{{ bag('i18n+' + this.alt, 'title.ingredients') }}:

    {%- for ing in this|enumIngredients(this.alt) %} {%- if ing['group'] %} @@ -46,7 +43,7 @@ {%- if ing['measure'] %}{{ ing['measure'] }} {% endif -%} {{ ing['name'] }} {%- if ing['note'] -%} - {{ ', ' ~ ing['note'] | replaceAtRefURLs(label=localize(this.alt, 'ingredients.recipeLink')) }} + {{ ', ' ~ ing['note'] | replaceAtRefURLs(label=bag('i18n+' + this.alt, 'ingredients.recipeLink')) }} {%- endif -%} {%- endif %} @@ -55,8 +52,8 @@
-

{{ localize(this.alt, 'title.directions') }}:

- {% if site.get('settings', alt=this.alt)['replace_temp'] -%} +

{{ bag('i18n+' + this.alt, 'title.directions') }}:

+ {% if site.get('/settings', alt=this.alt)['replace_temp'] -%} {{ this.directions.html|replace('Β°C', '℃')|replace('Β°F', '℉') }} {% else -%} {{ this.directions }} diff --git a/src/templates/recipes.html b/src/templates/recipes.html index dc1b11c..01931c6 100644 --- a/src/templates/recipes.html +++ b/src/templates/recipes.html @@ -1,9 +1,13 @@ {% extends "layout.html" %} {% from "macros/recipes.html" import render_recipe_list %} {% from "macros/pagination.html" import render_pagination_all %} -{% block title %}{{ localize(this.alt, 'title.recipes') }}{% endblock %} +{% block title %}{{ bag('i18n+' + this.alt, 'title.recipes') }}{% endblock %} {% block body %} -

{{ localize(this.alt, 'title.recipes') }} (PDF)

+

{{ + bag('i18n+' + this.alt, 'title.recipes') + }} (PDF)

{{ render_recipe_list(this.pagination.items) }} {{ render_pagination_all(this.pagination) }} {% endblock %} \ No newline at end of file diff --git a/src/templates/root.html b/src/templates/root.html index ca6a956..fe08a2c 100644 --- a/src/templates/root.html +++ b/src/templates/root.html @@ -1,7 +1,7 @@ {% extends "layout.html" %} {% from "macros/recipes.html" import render_recipe_list %} {% block body %} -

{{ localize(this.alt, 'title.latest') }}

+

{{ bag('i18n+' + this.alt, 'title.latest') }}

{{ render_recipe_list(site.query('recipes', this.alt).order_by('-date', 'name'), limit=6) }}