Skip to content

Commit

Permalink
fix(model): exclude non markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio La Barbera committed May 30, 2024
1 parent d3dade5 commit c7a753b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Models/MarkdownModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ private static function retrieveMarkdownFiles(): void
// Check if we already retrieved all files
if (! static::$allMarkdownFiles || count($allFiles) !== count(static::$allMarkdownFiles)) {
static::$allMarkdownFiles = (new MarkdownCollection($allFiles))
->mapWithKeys(function ($file) {
->filter(static function (string $file) {
return Str::endsWith($file, static::FILE_EXTENSION);
})
->mapWithKeys(static function (string $file) {
return [
static::extractFileId($file) => new static($file),
];
Expand Down

0 comments on commit c7a753b

Please sign in to comment.