-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.blade.php
More file actions
37 lines (31 loc) · 1.01 KB
/
index.blade.php
File metadata and controls
37 lines (31 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@php
$pages = query_pages("/blog/")->sortByDesc('published');
$pagination = paginate($pages);
// Canonical
$canonical = $pagination->current()->url(request_url());
if ($pagination->hasPrevious()) {
$prev = $pagination->getPrevious()->url(request_url());
}
if ($pagination->hasNext()) {
$next = $pagination->getNext()->url(request_url());
}
@endphp
@extends('base', [
'canonical' => $canonical ?? null,
'prev' => $prev ?? null,
'next' => $next ?? null,
])
@section('content')
<div class="container container-md">
<div class="row">
<div class="col-12">
<h1 class="d-none">Blog archive</h1>
@foreach($pagination->items() as $post)
@include('article', ['article' => $post, 'preview' => true])
@endforeach
{{-- Pagination --}}
@include('pagination', ['pagination' => $pagination])
</div>
</div>
</div>
@endsection