forked from em/receptty.org
		
	Použití makra pro výpis receptu
This commit is contained in:
		
							
								
								
									
										20
									
								
								templates/macros.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								templates/macros.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
{% macro print_recipe(recipe) %}
 | 
			
		||||
<article>
 | 
			
		||||
	<a href="{{ recipe.permalink }}">
 | 
			
		||||
		{% set_global image_found = 0 %}
 | 
			
		||||
		{% for asset in recipe.assets %}
 | 
			
		||||
			{% if asset is matching("[img.](jpg|png)$") %}
 | 
			
		||||
				<img src="{{ resize_image(path=asset, width=300, height=300, op="fill") }}" alt="Náhled">
 | 
			
		||||
				{% set_global image_found = 1 %}
 | 
			
		||||
				{% break %}
 | 
			
		||||
			{% endif %}
 | 
			
		||||
		{% endfor %}
 | 
			
		||||
		{% if image_found == 0 %}
 | 
			
		||||
			<img src="/temp.jpg" alt="Náhradní obrázek">
 | 
			
		||||
		{% endif %}
 | 
			
		||||
		{% set_global image_found = 0 %}
 | 
			
		||||
		{% if recipe.title %}<h3>{{ recipe.title }}</h3>{% endif %}
 | 
			
		||||
	</a>
 | 
			
		||||
	{% if recipe.date %}<span class="date">{{ recipe.date | date(format="%d.%m.%Y") }}</span>{% endif %}
 | 
			
		||||
</article>
 | 
			
		||||
{% endmacro print_recipe %}
 | 
			
		||||
		Reference in New Issue
	
	Block a user