This commit is contained in:
isUnknown 2025-01-07 16:54:08 +01:00
parent bff0f8eda3
commit cb1f842fc9
4 changed files with 53 additions and 14 deletions

View file

@ -8,6 +8,7 @@ function getFileData($file) {
'quality' => 80,
'format' => 'webp'
])->url(),
'source' => $file->url(),
'parent' => [
"title" => (string) $file->parent()->title(),
"uri" => $file->parent()->uri()
@ -28,10 +29,10 @@ function getFileData($file) {
$data['tags'] = $file->tags()->split();
};
if($file->comments()->exists()) {
if ($file->comments()->exists()) {
$data['comments'] = $file->comments()->exists() && $file->comments() ? Data::decode($file->comments()->value(), 'yaml') : [];
$data['cover'] = $file->cover()->exists() && $file->cover()->isNotEmpty() ? $file->cover()->toFile()->resize(576)->url() : false;
}
}
return $data;
}