summaryrefslogtreecommitdiff
path: root/config.php
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2021-05-20 23:15:30 +0100
committerDavid T. Sadler <davidtsadler@googlemail.com>2021-05-20 23:15:30 +0100
commit23af28d0587025ee2b41dd5620442309860d06d6 (patch)
tree259ea96b557a827bce402624d0833b7068100955 /config.php
parent04f7e8f440b98037e295fe16f0f948a8e9d0c234 (diff)
Remove Jigswaw files
Diffstat (limited to 'config.php')
-rw-r--r--config.php54
1 files changed, 0 insertions, 54 deletions
diff --git a/config.php b/config.php
deleted file mode 100644
index 2c5fb5b..0000000
--- a/config.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-
-use Illuminate\Support\Str;
-use Carbon\Carbon;
-
-$now = Carbon::now();
-
-return [
- 'baseUrl' => 'http://localhost:3000',
- 'production' => false,
- 'siteName' => 'davidtsadler.com',
- 'siteDescription' => 'My little bit of the Internet',
- 'siteAuthor' => 'David T. Sadler',
- 'perPage' => 50,
-
- 'collections' => [
- 'posts' => [
- // Default author, if not provided in a post
- 'author' => 'David T. Sadler',
- 'sort' => '-date',
- 'path' => '/posts',
- 'filter' => function ($item) use ($now) {
- // Include every post if in development.
- if (!$item->production) {
- return true;
- }
- // Only publish posts that have a date and which is not in the future.
- $date = $item->getDate();
- return $date ? $date <= $now : false;
- }
- ],
- 'tags' => [
- 'path' => '/tags/{filename}',
- 'posts' => function ($page, $allPosts) {
- return $allPosts->filter(function ($post) use ($page) {
- $tagSlugs = array_map(function ($tag) {
- return Str::slug($tag);
- }, $post->tags);
- return $post->tags ? in_array($page->getFilename(), $tagSlugs, true) : false;
- });
- },
- ],
- ],
-
- // Helpers
- 'getDate' => function ($page) use ($now) {
- // Use post date if one has been specified. Otherwise default to today's date in development.
- return $page->date ? Carbon::createFromFormat('U', $page->date) : ($page->production ? null : $now);
- },
-
- 'allTags' => function ($page, $allPosts) {
- return $allPosts->pluck('tags')->flatten()->unique()->sort();
- },
-];