{% load static %}
{% if has_older_posts and more_posts_url %}
<link rel="stylesheet" href="{% static 'css/scroll.min.css' %}">
<script async src="{% static 'js/scroll.min.js' %}"></script>
<script async type="text/javascript">
    window.more_url = "{{ more_posts_url }}";
    window.prev_page = {{ newer_posts }};
    window.extra_args = "{{ more_posts_url_args|default:'' }}"
    {% if has_older_posts %}
        window.next_page = {{ older_posts }};
    {% else %}
        window.next_page = 0;
    {% endif %}
    window.has_more = "{{ should_load_more }}";
    window.current_pagination = {{ page }} + {{ older_posts }};
    if (window.has_more == "True"){
        window.addEventListener('load', function () {
            load_more();
        });
    }
</script>
{% endif %}
