Add modular type into frontmatter

This commit is contained in:
Matias Griese
2014-10-08 15:14:46 +03:00
parent 0d587b087a
commit e763d347d9

View File

@@ -541,6 +541,15 @@ class AdminController
$page->name(((string) $input['type']) . '.md');
}
if ($page->modular() && isset($input['type'])) {
if (isset($input['frontmatter'])) {
$input['frontmatter'] = 'template: ' . $input['type'] . "\n" . $input['frontmatter'];
}
if (isset($input['header'])) {
$input['header']['template'] = $input['type'];
}
}
// special case for Expert mode build the raw, unset content
if (isset($input['frontmatter']) && isset($input['content'])) {
$page->raw("---\n" . (string) $input['frontmatter'] . "\n---\n" . (string) $input['content']);