1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-23 13:23:18 +02:00

feat(core): add routable option for entries #284

This commit is contained in:
Awilum
2019-11-30 23:03:09 +03:00
parent a381c75736
commit 5f560cf803

View File

@@ -480,6 +480,18 @@ class Entries
$data['published_by'] = (Session::exists('uuid') ? Session::get('uuid') : '');
$data['created_by'] = (Session::exists('uuid') ? Session::get('uuid') : '');
if (isset($data['routable']) && is_array($data['routable'])) {
$data['routable'] = $data['routable'];
} else {
$data['routable'] = true;
}
if (isset($data['visibility']) && in_array($data['visibility'], ['visible', 'draft', 'hidden'])) {
$data['visibility'] = $data['visibility'];
} else {
$data['visibility'] = 'visible';
}
return Filesystem::write($entry_file, $this->flextype['parser']->encode($data, 'frontmatter'));
}