OpenGraph pro jednotlivé recepty
All checks were successful
continuous-integration/drone Build is passing
All checks were successful
continuous-integration/drone Build is passing
This commit is contained in:
@ -10,21 +10,25 @@
|
||||
{% endif %}
|
||||
>
|
||||
<a href="{{ recipe.permalink }}">
|
||||
{% set_global image = "../static/temp.jpg" %}
|
||||
{% for asset in recipe.assets %}
|
||||
{% if asset is matching("[img.](jpg|png)$") %}
|
||||
{% set_global image = asset %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% set image = resize_image(path=image, width=300, height=300, op="fill") %}
|
||||
<div class="image" style="background-image: url('{{ image.url }}')"></div>
|
||||
<div class="image" style="background-image: url('{{ macro::recipe_preview_image(recipe=recipe) }}')"></div>
|
||||
<div class="title">{{ recipe.title }}</div>
|
||||
{% if recipe.date %}<span class="date">{{ recipe.date | date(format="%d.%m.%Y") }}</span>{% endif %}
|
||||
</a>
|
||||
</article>
|
||||
{% endmacro print_recipe %}
|
||||
|
||||
{% macro recipe_preview_image(recipe) %}
|
||||
{% set_global image = "../static/temp.jpg" %}
|
||||
{% for asset in recipe.assets %}
|
||||
{% if asset is matching("[img.](jpg|png)$") %}
|
||||
{% set_global image = asset %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% set image = resize_image(path=image, width=300, height=300, op="fill") %}
|
||||
{{ image.url }}
|
||||
{% endmacro recipe_preview_image %}
|
||||
|
||||
{% macro pagination() %}
|
||||
{% if paginator.previous %}
|
||||
<a href="{{ paginator.previous }}"><span class="icon icon-arrow-left2"></span></a>
|
||||
|
Reference in New Issue
Block a user