Commit df81966 1 parent 6747c14 commit df81966 Copy full SHA for df81966
File tree 1 file changed +5
-2
lines changed
packages/framework/src/Framework/Features/Publications
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 11
11
use Hyde \Pages \PublicationPage ;
12
12
use Illuminate \Support \Str ;
13
13
use Rgasch \Collection \Collection ;
14
+ use function collect ;
14
15
use function dirname ;
15
16
use function glob ;
16
17
use function Safe \file_get_contents ;
@@ -31,7 +32,7 @@ class PublicationService
31
32
public static function getPublicationTypes (): Collection
32
33
{
33
34
return Collection::create (self ::getSchemaFiles ())->mapWithKeys (function (string $ schemaFile ): array {
34
- $ publicationType = PublicationType::fromFile (Hyde:: pathToRelative ( $ schemaFile) );
35
+ $ publicationType = PublicationType::fromFile ($ schemaFile );
35
36
36
37
return [$ publicationType ->getDirectory () => $ publicationType ];
37
38
});
@@ -114,6 +115,8 @@ protected static function getPublicationFileData(string $filepath): string
114
115
115
116
protected static function getSchemaFiles (): array
116
117
{
117
- return glob (Hyde::path (Hyde::getSourceRoot ()).'/*/schema.json ' );
118
+ return collect (glob (Hyde::path (Hyde::getSourceRoot ()).'/*/schema.json ' ))->each (function (string $ path ): string {
119
+ return Hyde::pathToRelative ($ path );
120
+ })->toArray ();
118
121
}
119
122
}
You can’t perform that action at this time.
0 commit comments