Implement pagination and auto-sitemap

This commit is contained in:
tyler :3
2024-04-07 22:31:25 +01:00
parent ce376a8723
commit 8dd6aac2e6
9 changed files with 49 additions and 19 deletions

View File

@@ -30,9 +30,9 @@
{{ content }}
</div>
</article>
<a href="/">back home!</a>
<a id="generate-path" href="/">back home!</a>
</div>
</main>
<script src="/assets/js/get-correct-path.js"></script>
</body>
</html>

View File

@@ -19,15 +19,21 @@
<div class="container">
<h2 class="highlighted">article</h2>
<div id="articles">
{% for post in site.posts %}
<article>
<div class="card">
<img src="/assets/graphics/anon.png" alt="little face with sunglasses">
<a href="{{ post.url }}">{{ post.title }}</a>
<p>{{ post.date | date: "%d/%m/%y" }}</p>
</div>
</article>
{% for post in paginator.posts %}
<div class="card">
<img src="/assets/graphics/anon.png" alt="little face with sunglasses">
<a href="{{ post.url }}">{{ post.title }}</a>
<p>{{ post.date | date: "%d/%m/%y" }}</p>
</div>
{% endfor %}
<div class="paginate">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path }}">Previous page</a>
{% endif %}
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path }}">Next page</a>
{% endif %}
</div>
<p>or uhh just play <a href="#">minesweeper</a> :3</p>
<img src="/assets/graphics/cutiecat.png" alt="little animated cats in a line">
</div>