2021-02-02 22:01:42 +01:00
|
|
|
{% macro print_recipe(recipe) %}
|
2021-03-14 16:32:37 +01:00
|
|
|
<article
|
|
|
|
{% if recipe.taxonomies.tagy %}
|
|
|
|
{% for tag in recipe.taxonomies.tagy %}
|
|
|
|
{% if tag == "pikantní" %}
|
|
|
|
class="chilli"
|
|
|
|
{% break %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
>
|
2021-02-02 22:01:42 +01:00
|
|
|
<a href="{{ recipe.permalink }}">
|
2021-05-02 17:39:07 +02:00
|
|
|
{% set_global image = "../static/temp.jpg" %}
|
2021-02-02 22:01:42 +01:00
|
|
|
{% for asset in recipe.assets %}
|
|
|
|
{% if asset is matching("[img.](jpg|png)$") %}
|
2021-05-02 17:39:07 +02:00
|
|
|
{% set_global image = asset %}
|
2021-02-02 22:01:42 +01:00
|
|
|
{% break %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2021-09-29 20:03:54 +02:00
|
|
|
{% set image = resize_image(path=image, width=300, height=300, op="fill") %}
|
2022-09-06 11:45:23 +02:00
|
|
|
<div class="image" style="background-image: url('{{ image.url }}')"></div>
|
2022-04-19 18:20:11 +02:00
|
|
|
<div class="title">{{ recipe.title }}</div>
|
2021-03-29 10:51:36 +02:00
|
|
|
{% if recipe.date %}<span class="date">{{ recipe.date | date(format="%d.%m.%Y") }}</span>{% endif %}
|
2021-02-02 22:01:42 +01:00
|
|
|
</a>
|
|
|
|
</article>
|
|
|
|
{% endmacro print_recipe %}
|
2021-02-09 14:44:13 +01:00
|
|
|
|
|
|
|
{% macro pagination() %}
|
2022-09-06 15:12:13 +02:00
|
|
|
{% if paginator.previous %}
|
|
|
|
<a href="{{ paginator.previous }}"><span class="icon icon-arrow-left2"></span></a>
|
|
|
|
{% else %}
|
|
|
|
<span class="icon icon-arrow-left2"></span>
|
|
|
|
{% endif %}
|
2021-02-09 14:44:13 +01:00
|
|
|
<span>{{ paginator.current_index }} / {{ paginator.number_pagers }}</span>
|
2022-09-06 15:12:13 +02:00
|
|
|
{% if paginator.next %}
|
|
|
|
<a href="{{ paginator.next }}"><span class="icon icon-arrow-right2"></span></a>
|
|
|
|
{% else %}
|
|
|
|
<span class="icon icon-arrow-right2"></span>
|
|
|
|
{% endif %}
|
2021-02-09 14:44:13 +01:00
|
|
|
{% endmacro pagination %}
|
|
|
|
|
|
|
|
{% macro subnav() %}
|
|
|
|
<ul>
|
|
|
|
{% for item in config.extra.menu %}
|
|
|
|
<li><a href="{{ item.path }}">{{ item.name }}</a></li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endmacro subnav %}
|
|
|
|
|
2022-08-19 18:19:11 +02:00
|
|
|
{% macro tags_in_category() %}
|
|
|
|
{% set_global tags = [] %}
|
|
|
|
{% for page in term.pages %}
|
|
|
|
{% for tag in page.taxonomies.tagy %}
|
|
|
|
{% set_global tags = tags | concat(with=tag) %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
{% set_global tags = tags | sort | unique %}
|
|
|
|
{% for tag in tags %}
|
|
|
|
<span class="tag"><a href="{{ get_taxonomy_url(kind="tagy", name=tag) }}">{{ tag }}</a></span>
|
|
|
|
{% endfor %}
|
|
|
|
{% endmacro tags_in_category %}
|
|
|
|
|
2021-02-09 14:44:13 +01:00
|
|
|
{% macro recipe_image() %}
|
|
|
|
{% for asset in page.assets %}
|
|
|
|
{% if asset is matching("[img.](jpg|png)$") %}
|
2021-09-29 20:03:54 +02:00
|
|
|
{% set image = resize_image(path=asset, width=900, height=400, op="fill") %}
|
|
|
|
<a href="{{ get_url(path=asset) }}"><img src="{{ image.url }}" alt="Náhled"></a>
|
2021-02-09 14:44:13 +01:00
|
|
|
{% break %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endmacro recipe_image %}
|
|
|
|
|
|
|
|
{% macro recipe_meta() %}
|
2022-01-11 14:34:08 +01:00
|
|
|
{% if page.extra.portions %}<span class="item" title="Porce"><span class="icon icon-spoon-knife"></span>{{ page.extra.portions }}</span>{% endif %}
|
|
|
|
{% if page.extra.time %}<span class="item" title="Doba přípravy"><span class="icon icon-clock"></span>{{ page.extra.time }} min</span>{% endif %}
|
|
|
|
{% if page.extra.source %}<span class="item" title="Zdroj"><span class="icon icon-book"></span>{{ page.extra.source }}</span>{% endif %}
|
2021-02-09 14:44:13 +01:00
|
|
|
<a href="{{ config.extra.git }}/_edit/master/content/{{ page.relative_path }}" class="edit" title="Upravit"><span class="icon-pencil"></span></a>
|
|
|
|
{% endmacro recipe_meta %}
|
|
|
|
|
|
|
|
{% macro recipe_taxonomies() %}
|
|
|
|
{% if page.taxonomies.kategorie %}
|
|
|
|
{% set categories = page.taxonomies.kategorie %}
|
|
|
|
<div class="taglist">
|
|
|
|
Kategorie –
|
|
|
|
{% for term in categories %}
|
|
|
|
<span class="tag"><a href="{{ get_taxonomy_url(kind="kategorie", name=term) | safe }}">{{ term | capitalize() }}</a></span>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if page.taxonomies.tagy %}
|
|
|
|
{% set tags = page.taxonomies.tagy %}
|
|
|
|
<div class="taglist">
|
|
|
|
Tagy –
|
|
|
|
{% for term in tags %}
|
|
|
|
<span class="tag"><a href="{{ get_taxonomy_url(kind="tagy", name=term) | safe }}">{{ term | capitalize() }}</a></span>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro recipe_taxonomies %}
|
|
|
|
|
|
|
|
{% macro list_terms() %}
|
|
|
|
{% if terms %}
|
|
|
|
<ul>
|
|
|
|
{% for term in terms %}
|
|
|
|
<li><a href="{{ term.permalink }}">{{ term.name | capitalize() }}</a> ({{ term.pages | length }})</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro list_terms %}
|