From 15cba7137eb16990ef94fc91d16365da9a38c3a2 Mon Sep 17 00:00:00 2001 From: bangnokia Date: Sun, 24 Mar 2024 06:39:35 +0700 Subject: [PATCH] wip --- app/Commands/BuildCommand.php | 2 +- app/ContentFinder.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Commands/BuildCommand.php b/app/Commands/BuildCommand.php index 0e33128..e180a09 100644 --- a/app/Commands/BuildCommand.php +++ b/app/Commands/BuildCommand.php @@ -18,7 +18,7 @@ public function handle(): int // file_get_contents('https://ping2.me/@daudau/debug?message=building'); $finder = app(ContentFinder::class); - $items = $finder->index('./'); + $items = $finder->index(); $renderer = app(MarkdownRenderer::class); $this->warn('Building your site...'); diff --git a/app/ContentFinder.php b/app/ContentFinder.php index f99b4d6..9bdcdff 100644 --- a/app/ContentFinder.php +++ b/app/ContentFinder.php @@ -64,10 +64,10 @@ public function get(string $filePath, $absolute = false): Content ); } - public function index(string $directory): array + public function index(string $directory = ''): array { $posts = []; - $finder = (new Finder())->in($this->workingDir . ltrim('/' . $directory)); + $finder = (new Finder())->in($this->workingDir . ltrim('/' . $directory))->name('*.md'); foreach ($finder as $file) { if ($file->isDir()) {