chore(default.php): cleanup indents and braces
This commit is contained in:
parent
fd17056c12
commit
f642e66252
1 changed files with 6 additions and 9 deletions
|
@ -2,20 +2,17 @@
|
|||
<!-- Powered by dummy-ssg -->
|
||||
<?php
|
||||
// let's use simple key-value headers instead of json
|
||||
$raw = file_get_contents("src/" . $page["path"]);
|
||||
preg_match('/^---\n\s*(.*?)\s*\n---\n/s', $raw, $matches);
|
||||
if (!empty($matches[1])) {
|
||||
$raw = file_get_contents("src/" . $page["path"]);
|
||||
preg_match('/^---\n\s*(.*?)\s*\n---\n/s', $raw, $matches);
|
||||
if (!empty($matches[1])) {
|
||||
foreach (explode("\n", $matches[1]) as $line) {
|
||||
$line = trim($line);
|
||||
if ($line === '') {
|
||||
continue;
|
||||
}
|
||||
if ($line === '') continue;
|
||||
$kv = explode(' ', $line, 2);
|
||||
if (empty($kv[1])) {
|
||||
if (empty($kv[1]))
|
||||
$page[$kv[0]] = true;
|
||||
} else {
|
||||
else
|
||||
$page[$kv[0]] = $kv[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue