diff --git a/templates/index.html b/templates/index.html index 14f6c3c..ff1532e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -20,11 +20,7 @@ @@ -37,11 +33,9 @@ {{ macro::print_recipe(recipe=page) }} {% endfor %} - + diff --git a/templates/kategorie/list.html b/templates/kategorie/list.html index 0431e36..38572a9 100644 --- a/templates/kategorie/list.html +++ b/templates/kategorie/list.html @@ -4,12 +4,6 @@

Kategorie


- {% if terms %} - - {% endif %} + {{ macro::list_terms() }}
{% endblock content %} diff --git a/templates/macros.html b/templates/macros.html index d0c41fb..d588576 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -18,3 +18,65 @@ {% if recipe.date %}{{ recipe.date | date(format="%d.%m.%Y") }}{% endif %} {% endmacro print_recipe %} + +{% macro pagination() %} + {% if paginator.previous %}« Předchozí stránka |{% endif %} + {{ paginator.current_index }} / {{ paginator.number_pagers }} + {% if paginator.next %}| Další stránka »{% endif %} +{% endmacro pagination %} + +{% macro subnav() %} + +{% endmacro subnav %} + +{% macro recipe_image() %} + {% for asset in page.assets %} + {% if asset is matching("[img.](jpg|png)$") %} + Náhled + {% break %} + {% endif %} + {% endfor %} +{% endmacro recipe_image %} + +{% macro recipe_meta() %} + {% if page.extra.portions %}Porce: {{ page.extra.portions }}{% endif %} + {% if page.extra.time %}Doba přípravy: {{ page.extra.time }} min{% endif %} + {% if page.extra.source %}Zdroj: {{ page.extra.source }}{% endif %} + +{% endmacro recipe_meta %} + +{% macro recipe_taxonomies() %} + {% if page.taxonomies.kategorie %} + {% set categories = page.taxonomies.kategorie %} +
+ Kategorie –  + {% for term in categories %} + {{ term | capitalize() }} + {% endfor %} +
+ {% endif %} + + {% if page.taxonomies.tagy %} + {% set tags = page.taxonomies.tagy %} +
+ Tagy –  + {% for term in tags %} + {{ term | capitalize() }} + {% endfor %} +
+ {% endif %} +{% endmacro recipe_taxonomies %} + +{% macro list_terms() %} + {% if terms %} + + {% endif %} +{% endmacro list_terms %} diff --git a/templates/page.html b/templates/page.html index ae2a962..f6db7c6 100644 --- a/templates/page.html +++ b/templates/page.html @@ -7,44 +7,17 @@

{{ page.title | upper }}


- {% for asset in page.assets %} - {% if asset is matching("[img.](jpg|png)$") %} - Náhled - {% break %} - {% endif %} - {% endfor %} + {{ macro::recipe_image() }} - {% if page.extra.image %}Náhled{% endif %}
- {% if page.extra.portions %}Porce: {{ page.extra.portions }}{% endif %} - {% if page.extra.time %}Doba přípravy: {{ page.extra.time }} min{% endif %} - {% if page.extra.source %}Zdroj: {{ page.extra.source }}{% endif %} - + {{ macro::recipe_meta() }}
{{ page.content | safe }}
- {% if page.taxonomies.kategorie %} - {% set categories = page.taxonomies.kategorie %} -
- Kategorie –  - {% for term in categories %} - {{ term | capitalize() }} - {% endfor %} -
- {% endif %} - - {% if page.taxonomies.tagy %} - {% set tags = page.taxonomies.tagy %} -
- Tagy –  - {% for term in tags %} - {{ term | capitalize() }} - {% endfor %} -
- {% endif %} + {{ macro::recipe_taxonomies() }} {% endblock content %} diff --git a/templates/tagy/list.html b/templates/tagy/list.html index 2c97af2..0466876 100644 --- a/templates/tagy/list.html +++ b/templates/tagy/list.html @@ -4,12 +4,6 @@

Tagy


- {% if terms %} - - {% endif %} + {{ macro::list_terms() }}
{% endblock content %}