summaryrefslogtreecommitdiff
path: root/source/index.blade.php
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2020-02-21 21:09:36 +0000
committerDavid T. Sadler <davidtsadler@googlemail.com>2020-02-21 21:09:36 +0000
commit9ea58efcba563ec7572ce155788e7b44a59de3c6 (patch)
tree7c13932af559afcd297c6f99214a16ee557bf336 /source/index.blade.php
parenta12d45489a078f8067489ef8b42745c7b46e9a9a (diff)
Add pagincation to home page
Diffstat (limited to 'source/index.blade.php')
-rw-r--r--source/index.blade.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/index.blade.php b/source/index.blade.php
index d474972..998f56a 100644
--- a/source/index.blade.php
+++ b/source/index.blade.php
@@ -1,9 +1,21 @@
+---
+pagination:
+ collection: posts
+---
@extends('_layouts.master')
@section('article')
<ol>
- @foreach ($posts as $post)
- <li><a href="{{ $post->getUrl() }}">{{$post->title }}</a></li>
- @endforeach
+ @foreach ($pagination->items as $post)
+ <li><a href="{{ $post->getUrl() }}">{{$post->title }}</a></li>
+ @endforeach
</ol>
+ <nav>
+ @if ($pagination->previous)
+ <a href="{{ $pagination->previous }}">See more recent posts</a>
+ @endif
+ @if ($pagination->next)
+ <a href="{{ $pagination->next }}">See older posts</a>
+ @endif
+ </nav>
@endsection