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

View file

@ -13,8 +13,8 @@ $slugify = new Slugify();
function get_active($draft) function get_active($draft)
{ {
if ($draft == '1') if ($draft == '1')
return 2; return FALSE;
return 1; return TRUE;
} }
function import_posts($db) function import_posts($db)
@ -42,7 +42,9 @@ function import_posts($db)
'active' => get_active($post['is_draft']), 'active' => get_active($post['is_draft']),
'published_at' => $post['posted_at'], 'published_at' => $post['posted_at'],
'password' => $post['password'], 'password' => $post['password'],
'tags' => $tagarray 'tags' => $tagarray,
'extends' => '_layouts.post',
'section' => 'content'
]; ];
$slug = $slugify->slugify($post['name']); $slug = $slugify->slugify($post['name']);
$content = '---'.PHP_EOL.Yaml::dump($metadata).'---' $content = '---'.PHP_EOL.Yaml::dump($metadata).'---'
@ -65,6 +67,8 @@ function import_pages($db)
$metadata = [ $metadata = [
'title' => $page['name'], 'title' => $page['name'],
'active' => get_active($page['is_draft']), 'active' => get_active($page['is_draft']),
'extends' => '_layouts.page',
'section' => 'content',
]; ];
$slug = $slugify->slugify($page['name']); $slug = $slugify->slugify($page['name']);
$filename = './markdown/'.$slug.'.md'; $filename = './markdown/'.$slug.'.md';