get_active fix, jigsaw metadata

This commit is contained in:
Alexander Yakovlev 2019-06-18 13:04:52 +07:00
parent 56da7fc57e
commit 90c51e3397
Signed by: oreolek
GPG Key ID: 1CDC4B7820C93BD3
1 changed files with 7 additions and 3 deletions

View File

@ -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';