Skip to content

Commit

Permalink
Add patch to reject readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jun 8, 2024
1 parent 8ba3317 commit c47b59f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/Extend/DataCollections.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ protected static function getTypedYaml(string $name): static
protected static function getTypedMarkdown(string $name): static
{
$className = self::getCallableTypeClassName($name);

return parent::markdown($name)->map(fn (MarkdownDocument $document) => new $className(array_merge(
$document->matter()->toArray(),
['markdown' => $document->markdown()->body()]
)));
return parent::markdown($name)->reject(fn (MarkdownDocument $document, string $key) => basename($key) === 'README.md') // Patch until https://github.com/hydephp/develop/issues/1716
->map(fn (MarkdownDocument $document) => new $className(array_merge(
$document->matter()->toArray(),
['markdown' => $document->markdown()->body()]
)));
}

protected static function getTypePath(string $name): string
Expand Down Expand Up @@ -85,6 +85,8 @@ class_alias($newClassName, $className);

protected static function findFiles(string $name, array|string $extensions): Collection
{
// Depends on https://github.com/hydephp/develop/issues/1716

return parent::findFiles($name, $extensions)->reject(fn (string $file) => basename($file) === 'README.md');
}
}

0 comments on commit c47b59f

Please sign in to comment.