下書き記事
This commit is contained in:
@@ -7,7 +7,7 @@ class BlogPost {
|
||||
*
|
||||
* @return array 投稿の配列
|
||||
*/
|
||||
public function getPosts(string $section, ?\stdClass $user): array {
|
||||
public function getPosts(string $section, ?\stdClass $user = null): array {
|
||||
$path = ROOT.$section;
|
||||
$posts = [];
|
||||
$isMember = $user !== NULL && $user->role !== \Roles::BANNED;
|
||||
@@ -45,6 +45,7 @@ class BlogPost {
|
||||
$articleBody = trim($parts[1]);
|
||||
$preview = mb_substr(strip_tags($articleBody), 0, 50).'...';
|
||||
$slug = basename($file, '.md');
|
||||
if (isset($metadata['draft']) && !$isStaff) continue;
|
||||
|
||||
$posts[] = [
|
||||
'title' => $metadata['title'] ?? '',
|
||||
|
||||
Reference in New Issue
Block a user