45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
---
|
|
pagination:
|
|
collection: posts
|
|
perPage: 5
|
|
---
|
|
|
|
@extends('_layouts.main')
|
|
|
|
@section('body')
|
|
@foreach($pagination->items as $post)
|
|
<article>
|
|
<section>
|
|
<h2><a href="{{ $post->getUrl() }}">{{ $post->title }}</a></h2><small>{{ $page->dateTranslated($post->date) }}</small>
|
|
</section>
|
|
<section>
|
|
<p>
|
|
{{ $post->excerpt() }}
|
|
</p>
|
|
</section>
|
|
</article>
|
|
<hr>
|
|
@endforeach
|
|
<section class="paginationNavigation">
|
|
@if ($previous = $pagination->previous)
|
|
<a href="{{ $page->baseUrl }}{{ $pagination->first }}"><<</a>
|
|
<a href="{{ $page->baseUrl }}{{ $previous }}"><</a>
|
|
@else
|
|
<< <
|
|
@endif
|
|
|
|
@foreach ($pagination->pages as $pageNumber => $path)
|
|
@if($pageNumber !== 1) @endif
|
|
<a href="{{ $page->baseUrl }}{{ $path }}"
|
|
class="{{ $pagination->currentPage == $pageNumber ? 'selected' : '' }}">{{ $pageNumber }}</a>
|
|
@endforeach
|
|
|
|
@if ($next = $pagination->next)
|
|
<a href="{{ $page->baseUrl }}{{ $next }}">></a>
|
|
<a href="{{ $page->baseUrl }}{{ $pagination->last }}">>></a>
|
|
@else
|
|
> >>
|
|
@endif
|
|
</section>
|
|
|
|
@endsection
|