{% extends "base.html" %}

{% block content %}
<h1>{{ section.title }}</h1>

{{ section.description | markdown | safe }}

<small>
	<a class="link-page" href="{{ get_url(path='tags', lang=lang) }}">{{ trans(key="filter_by_tag", lang=lang) }}</a>
	<br />
	{{ trans(key="newest_to_oldest", lang=lang) }} ↓
</small>

<div id="article-list">
	{% for page in section.pages %}
		<article {% if page.draft %}class="draft"{% endif %}>
			<h3><a class="link-page" href="{{ page.permalink | safe }}">{{ page.title }}</a></h3>
			{%- if page.draft %}
				<span class="draft-badge">
					<i class="icon"></i>
					{{ trans(key="drafted", lang=lang) }}
				</span>
			{%- endif %}
			{%- if page.extra.archive %}
				<span class="archive-badge">
					<i class="icon"></i>
					{{ trans(key="archived", lang=lang) }}
				</span>
			{%- endif %}
			{%- if page.description %}
				{{ page.description | markdown | safe }}
			{%- endif %}
			{%- if page.date %}
				<small>
					<time datetime="{{ page.date | date(format='%+') }}" pubdate>{{- page.date | date(format=config.extra.date_format) -}}</time>
					{%- if page.authors %}
						<span>•</span>
						<span>{{ trans(key="author", lang=lang) }}: {{ page.authors[0] }}</span>
					{%- endif %}
					{%- if page.taxonomies %}
						{%- for name, taxon in page.taxonomies %}
							<span>•</span>
							<ul class="tags">
								{%-for item in taxon %}
									<li><a class="tag" href="{{ get_taxonomy_url(kind=name, name=item, lang=lang) }}">{{ item }}</a></li>
								{%- endfor %}
							</ul>
						{%- endfor %}
					{%- endif %}
				</small>
			{%- endif %}
		</article>
		<hr>
	{% endfor %}
</div>
{% endblock content %}
