From 8ba3317e28e301e52bd86e34f352514b3f6911c6 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sat, 8 Jun 2024 11:11:51 +0200 Subject: [PATCH] Override file finder to reject readme files --- app/Extend/DataCollections.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Extend/DataCollections.php b/app/Extend/DataCollections.php index 8a0ecd76..b4b21ca2 100644 --- a/app/Extend/DataCollections.php +++ b/app/Extend/DataCollections.php @@ -5,6 +5,7 @@ namespace App\Extend; use Hyde\Facades\Filesystem; +use Illuminate\Support\Collection; use Hyde\Markdown\Models\FrontMatter; use Illuminate\Support\Str; use Hyde\Markdown\Models\MarkdownDocument; @@ -81,4 +82,9 @@ class_alias($newClassName, $className); return $className; } + + protected static function findFiles(string $name, array|string $extensions): Collection + { + return parent::findFiles($name, $extensions)->reject(fn (string $file) => basename($file) === 'README.md'); + } }