sass-site/source/blog.liquid

36 lines
1015 B
Plaintext
Raw Normal View History

---
2023-03-08 23:48:53 +01:00
layout: has_no_sidebars
title: Sass Blog
pagination:
data: collections.blog
size: 5
alias: posts
2023-03-03 16:39:31 +01:00
reverse: true
2023-03-08 23:48:53 +01:00
permalink: '/blog/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumber | plus: 1 }}/{% endif %}index.html'
---
2023-03-08 23:48:53 +01:00
{% assign pageNumber = pagination.pageNumber | plus: 1 %}
{% assign pages = pagination.pages.size %}
{% if pages > 1 %}
<p>Page {{ pageNumber }} of {{ pagination.pages.size }}</p>
{% if pagination.page.previous %}
<p><a href="{{ pagination.href.previous }}">Previous page</a></p>
2023-03-03 16:39:31 +01:00
{% endif %}
2023-03-08 23:48:53 +01:00
{% endif %}
<ul class="sl-c-list">
{% for post in posts %}
2023-03-03 16:39:31 +01:00
<li>
2023-03-08 23:48:53 +01:00
<h2><a href="{{post.url}}">{{ post.data.title }}</a></h2>
{% render 'attribution', date: post.date, author: post.data.author %}
{% # @@@ This shouls also replace internal links with links to the page %}
{{ post.content | truncateHTML }}
2023-03-03 16:39:31 +01:00
</li>
2023-03-08 23:48:53 +01:00
{% endfor %}
</ul>
{% if pagination.page.next %}
<p><a href="{{ pagination.href.next }}">Next page</a></p>
{% endif %}