~crocmagnon/blog

ref: bd938138a26f7c54e34d1237c8650c4ff877500f blog/articles/templates/articles/article_list.html -rw-r--r-- 1.0 KiB
bd938138Gabriel Augendre Add link to deployed commit in footer 6 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{% extends 'articles/base.html' %}

{% block title %}
    {{ title }}
{% endblock %}
{% block content %}
    <h1>{{ title }} list</h1>
    {% for article in articles %}
        <article class="article-list">
            <h2><a href="{% url 'article-detail' slug=article.slug %}">{{ article.title }}</a></h2>
            {% include "articles/metadata_snippet.html" %}
            {{ article.get_abstract|safe }}
            <p class="read-more"><a href="{% url 'article-detail' slug=article.slug %}">Read more...</a></p>
        </article>
    {% empty %}
        <p>No article here. Come back later 🙂</p>
    {% endfor %}
    <nav class="pagination">
        <div class="older">
            {% if page_obj.has_next %}
                <a href="?page={{ page_obj.next_page_number }}">⇠ Older</a>
            {% endif %}
        </div>
        <div class="newer">
            {% if page_obj.has_previous %}
                <a href="?page={{ page_obj.previous_page_number }}">Newer ⇢</a>
            {% endif %}
        </div>
    </nav>
{% endblock %}