get_active fix, jigsaw metadata
This commit is contained in:
parent
56da7fc57e
commit
90c51e3397
|
@ -13,8 +13,8 @@ $slugify = new Slugify();
|
|||
function get_active($draft)
|
||||
{
|
||||
if ($draft == '1')
|
||||
return 2;
|
||||
return 1;
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
function import_posts($db)
|
||||
|
@ -42,7 +42,9 @@ function import_posts($db)
|
|||
'active' => get_active($post['is_draft']),
|
||||
'published_at' => $post['posted_at'],
|
||||
'password' => $post['password'],
|
||||
'tags' => $tagarray
|
||||
'tags' => $tagarray,
|
||||
'extends' => '_layouts.post',
|
||||
'section' => 'content'
|
||||
];
|
||||
$slug = $slugify->slugify($post['name']);
|
||||
$content = '---'.PHP_EOL.Yaml::dump($metadata).'---'
|
||||
|
@ -65,6 +67,8 @@ function import_pages($db)
|
|||
$metadata = [
|
||||
'title' => $page['name'],
|
||||
'active' => get_active($page['is_draft']),
|
||||
'extends' => '_layouts.page',
|
||||
'section' => 'content',
|
||||
];
|
||||
$slug = $slugify->slugify($page['name']);
|
||||
$filename = './markdown/'.$slug.'.md';
|
||||
|
|
Loading…
Reference in New Issue