Add pagination to blog
This commit is contained in:
		
							parent
							
								
									115a00b8fc
								
							
						
					
					
						commit
						a25850a146
					
				| 
						 | 
				
			
			@ -2,14 +2,18 @@
 | 
			
		|||
title: Blog
 | 
			
		||||
permalink: /blog/
 | 
			
		||||
override:tags: []
 | 
			
		||||
pagination:
 | 
			
		||||
  data: collections.blog
 | 
			
		||||
  size: 2
 | 
			
		||||
  generatePageOnEmptyData: true
 | 
			
		||||
eleventyNavigation:
 | 
			
		||||
  key: Blog
 | 
			
		||||
  order: 2
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
{%- for post in collections.blog reversed -%}
 | 
			
		||||
  {% if forloop.first == true %}<ul>{% endif %}
 | 
			
		||||
<ul>
 | 
			
		||||
{%- for post in pagination.items %}
 | 
			
		||||
  <li><a href="{{ post.url }}">{{ post.data.title }}</a>
 | 
			
		||||
  — <i>updated <time datetime="{{ post.date | formatDate }}">{{ post.date | formatDate }}</time></i></li>
 | 
			
		||||
  {% if forloop.last == true %}</ul>{% endif %}
 | 
			
		||||
{%- endfor -%}
 | 
			
		||||
{% endfor -%}
 | 
			
		||||
</ul>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue