Skip to content

Commit 947c6b7

Browse files
authored
Merge pull request #354 from LibreSign/feat/accept-png-cover
feat: accept png
2 parents 7764a47 + 7162b1e commit 947c6b7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

config.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,12 @@
284284
if(empty($post->cover_image)){
285285
if(file_exists(__DIR__.'/source/'.$path.'/cover.jpg')){
286286
$post->set('cover_image',$post->baseUrl.$path.'/cover.jpg');
287+
} elseif(file_exists(__DIR__.'/source/'.$path.'/cover.png')){
288+
$post->set('cover_image',$post->baseUrl.$path.'/cover.png');
287289
} elseif(file_exists(__DIR__.'/source/'.$alternativePath.'/cover.jpg')){
288290
$post->set('cover_image',$post->baseUrl.$alternativePath.'/cover.jpg');
291+
} elseif(file_exists(__DIR__.'/source/'.$alternativePath.'/cover.png')){
292+
$post->set('cover_image',$post->baseUrl.$alternativePath.'/cover.png');
289293
} else {
290294
$post->set('cover_image',$post->baseUrl.'assets/images/logo/logo.svg');
291295
}
@@ -294,8 +298,12 @@
294298
if(empty($post->banner)){
295299
if(file_exists(__DIR__.'/source/'.$path.'/banner.jpg')){
296300
$post->set('banner',$post->baseUrl.$path.'/banner.jpg');
301+
} elseif(file_exists(__DIR__.'/source/'.$path.'/banner.png')){
302+
$post->set('banner',$post->baseUrl.$path.'/banner.png');
297303
} elseif(file_exists(__DIR__.'/source/'.$alternativePath.'/banner.jpg')){
298304
$post->set('banner',$post->baseUrl.$alternativePath.'/banner.jpg');
305+
} elseif(file_exists(__DIR__.'/source/'.$alternativePath.'/banner.png')){
306+
$post->set('banner',$post->baseUrl.$alternativePath.'/banner.png');
299307
} else {
300308
$post->set('banner',$post->baseUrl.'assets/images/logo/logo.svg');
301309
}

0 commit comments

Comments
 (0)