diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2020-03-08 00:02:58 +0000 |
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2020-03-08 00:02:58 +0000 |
| commit | c9a12d334c21593f9d7eb0fd74f6e78d3166a4cc (patch) | |
| tree | 1843fc03201b71726d1c6fb05eac43ecb81d71dd | |
| parent | ae89e1bc7e9b4075edd8aff308d9c843da1a1729 (diff) | |
Style pagination
| -rw-r--r-- | config.php | 18 | ||||
| -rw-r--r-- | source/index.blade.php | 6 |
2 files changed, 12 insertions, 12 deletions
@@ -16,16 +16,16 @@ return [ // Default author, if not provided in a post 'author' => 'David T. Sadler', 'sort' => '-date', - 'path' => '/{filename}', + 'path' => '/posts/{date|Y-m-d}/{filename}', ], - 'categories' => [ - 'path' => '/categories/{filename}', + 'tags' => [ + 'path' => '/tags/{filename}', 'posts' => function ($page, $allPosts) { return $allPosts->filter(function ($post) use ($page) { - $categorySlugs = array_map(function ($category) { - return Str::slug($category); - }, $post->categories); - return $post->categories ? in_array($page->getFilename(), $categorySlugs, true) : false; + $tagSlugs = array_map(function ($tag) { + return Str::slug($tag); + }, $post->tags); + return $post->tags ? in_array($page->getFilename(), $tagSlugs, true) : false; }); }, ], @@ -36,7 +36,7 @@ return [ return Datetime::createFromFormat('U', $page->date); }, - 'allCategories' => function ($page, $allPosts) { - return $allPosts->pluck('categories')->flatten()->unique(); + 'allTags' => function ($page, $allPosts) { + return $allPosts->pluck('tags')->flatten()->unique()->sort(); }, ]; diff --git a/source/index.blade.php b/source/index.blade.php index e9b24e1..7097fdb 100644 --- a/source/index.blade.php +++ b/source/index.blade.php @@ -10,12 +10,12 @@ pagination: @include('_partials.postStub') @endforeach </ol> - <nav> + <nav class="mt-3 px-4 flex justify-between text-gray-400 text-2xl"> @if ($pagination->previous) - <a href="{{ $pagination->previous }}">See more recent posts</a> + <a href="{{ $pagination->previous }}"><< Recent Posts</a> @endif @if ($pagination->next) - <a href="{{ $pagination->next }}">See older posts</a> + <a href="{{ $pagination->next }}">Older Posts >></a> @endif </nav> @endsection |
