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 -->
|
<!-- Powered by dummy-ssg -->
|
||||||
<?php
|
<?php
|
||||||
// let's use simple key-value headers instead of json
|
// let's use simple key-value headers instead of json
|
||||||
$raw = file_get_contents("src/" . $page["path"]);
|
$raw = file_get_contents("src/" . $page["path"]);
|
||||||
preg_match('/^---\n\s*(.*?)\s*\n---\n/s', $raw, $matches);
|
preg_match('/^---\n\s*(.*?)\s*\n---\n/s', $raw, $matches);
|
||||||
if (!empty($matches[1])) {
|
if (!empty($matches[1])) {
|
||||||
foreach (explode("\n", $matches[1]) as $line) {
|
foreach (explode("\n", $matches[1]) as $line) {
|
||||||
$line = trim($line);
|
$line = trim($line);
|
||||||
if ($line === '') {
|
if ($line === '') continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$kv = explode(' ', $line, 2);
|
$kv = explode(' ', $line, 2);
|
||||||
if (empty($kv[1])) {
|
if (empty($kv[1]))
|
||||||
$page[$kv[0]] = true;
|
$page[$kv[0]] = true;
|
||||||
} else {
|
else
|
||||||
$page[$kv[0]] = $kv[1];
|
$page[$kv[0]] = $kv[1];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue