sass-site/source/blog.liquid
2023-03-08 17:48:53 -05:00

36 lines
1015 B
Plaintext

---
layout: has_no_sidebars
title: Sass Blog
pagination:
data: collections.blog
size: 5
alias: posts
reverse: true
permalink: '/blog/{% if pagination.pageNumber > 0 %}page/{{ pagination.pageNumber | plus: 1 }}/{% endif %}index.html'
---
{% 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>
{% endif %}
{% endif %}
<ul class="sl-c-list">
{% for post in posts %}
<li>
<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 }}
</li>
{% endfor %}
</ul>
{% if pagination.page.next %}
<p><a href="{{ pagination.href.next }}">Next page</a></p>
{% endif %}