---
    pagination:
        data: collections.postlist
        size: 12
        alias: postsHome
        reverse: true
---

<!DOCTYPE html>
<html lang="en">
<head>
    {% include 'head.html' %}
</head>
<body>
    {% include 'topbar.html' %}
    <div id="tag">
        {{ content | safe }}
    </div>
    <main>
        <ul class="postlist">
            {% for post in postsHome %}
                <li><h3><a href="{{ post.url }}">{{ post.data.title | safe }}</a></h3></li>
            {% endfor %}
        </ul>
        <p class="pagination">
            {% if page.url != pagination.href.last %}
            <a href="{{ pagination.href.next }}">Prev Page</a>{% endif %} -
            {% if page.url != pagination.href.first %}
            <a href="{{ pagination.href.previous }}">Next Page</a>{% endif %}
        </p>
<!--
<p>Debug Info:</p>
<ul>
  <li>Current Page: {{ pagination.pageNumber }}</li>
  <li>Next Link: {{ pagination.href.next }}</li>
  <li>Previous Link: {{ pagination.href.previous }}</li>
  <li>Total Pages: {{ pagination.pages.length }}</li>
</ul>
<h3>Total posts found in collection: {{ collections.postlist.length }}</h3>
<ul>
{% for p in collections.postlist %}
  <li>{{ p.inputPath }}</li>
{% endfor %}
</ul>
-->
    </main>
    
    <footer class="page-footer">
        <small>- {{ site.author }}</small>
    </footer>
</body>
</html>