Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
benbjurstrom committed May 14, 2024
1 parent ea2a6d6 commit 4e4fac6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Actions/GetAllPosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ public static function handle(): Collection
$slug = pathinfo($relativePath, PATHINFO_DIRNAME).'/'.pathinfo($relativePath, PATHINFO_FILENAME);
$fm['slug'] = $slug;

// depending on the environment, the date may be a string or a timestamp
if (! empty($fm['date']) && is_string($fm['date'])) {
$fm['date'] = strtotime($fm['date']);
}

return $fmClass::fromArray($fm);
})->reject(function ($value) {
return $value === false;
Expand Down

0 comments on commit 4e4fac6

Please sign in to comment.