diff --git a/templates/index.html b/templates/index.html index 8ca0d0d..9efce84 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,3 +1,4 @@ +{% import "macros.html" as macro %} @@ -31,30 +32,9 @@

Nejnovější recepty


- {% for page in paginator.pages %} -
- - - {% set_global image_found = 0 %} - {% for asset in page.assets %} - {% if asset is matching("[img.](jpg|png)$") %} - Náhled - {% set_global image_found = 1 %} - {% break %} - {% endif %} - {% endfor %} - {% if image_found == 0 %} - Náhradní obrázek - {% endif %} - {% set_global image_found = 0 %} - {% if page.title %}

{{ page.title }}

{% endif %} -
- {% if page.date %}{{ page.date | date(format="%d.%m.%Y") }}{% endif %} - -
+ {{ macro::print_recipe(recipe=page) }} {% endfor %} -
- list + {% set section = get_section(path="_index.md") %} + {% for page in section.pages %} + {{ macro::print_recipe(recipe=page) }} + {% endfor %}
{% endblock content %} diff --git a/templates/tagy/single.html b/templates/tagy/single.html index 6f64c52..f660048 100644 --- a/templates/tagy/single.html +++ b/templates/tagy/single.html @@ -6,27 +6,7 @@
{% for page in term.pages %} -
- - - {% set_global image_found = 0 %} - {% for asset in page.assets %} - {% if asset is matching("[img.](jpg|png)$") %} - Náhled - {% set_global image_found = 1 %} - {% break %} - {% endif %} - {% endfor %} - {% if image_found == 0 %} - Náhradní obrázek - {% endif %} - {% set_global image_found = 0 %} - - - {% if page.title %}

{{ page.title }}

{% endif %} - {% if page.date %}{{ page.date | date(format="%d.%m.%Y") }}{% endif %} - -
+ {{ macro::print_recipe(recipe=page) }} {% endfor %}