Nahrání lokálních souborů

This commit is contained in:
Emil Miler
2019-10-30 11:58:46 +01:00
commit dd8a1ab8cc
66 changed files with 1436 additions and 0 deletions

15
templates/tagy/list.html Normal file
View File

@ -0,0 +1,15 @@
{% extends "index.html" %}
{% block content %}
<main>
<h2>Tagy</h2>
<hr>
{% if terms %}
<ul>
{% for term in terms %}
<li><a href="{{ term.permalink }}">{{ term.name | capitalize() }}</a> ({{ term.pages | length }})</li>
{% endfor %}
</ul>
{% endif %}
</main>
{% endblock content %}

View File

@ -0,0 +1,33 @@
{% extends "index.html" %}
{% block content %}
<main>
<h2>{{ term.name | capitalize() }}</h2>
<hr>
<section class="list">
{% for page in term.pages %}
<article>
<a href="{{ page.permalink }}">
{% set_global image_found = 0 %}
{% for asset in page.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 %}
</a>
{% if page.title %}<a href="{{ page.permalink }}"><h3>{{ page.title }}</h3></a>{% endif %}
{% if page.date %}<span class="date">{{ page.date | date(format="%d.%m.%Y") }}</span>{% endif %}
</article>
{% endfor %}
</section>
</main>
{% endblock content %}