1
0
mirror of https://github.com/danog/sass-site.git synced 2024-12-14 10:28:05 +01:00
sass-site/source/blog.liquid
2023-03-09 11:19:39 -05:00

41 lines
989 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 {{ pages }}</p>
{% if pagination.href.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 %}
{{ post.content | truncateHTML | replaceInternalLinks: post.url }}
</li>
{% endfor %}
</ul>
{% if pagination.href.next %}
<p>
<a href="{{ pagination.href.next }}">Next page</a>
</p>
{% endif %}