chore(default.php): cleanup indents and braces

This commit is contained in:
NaitLee 2025-09-26 18:39:51 +08:00
parent fd17056c12
commit f642e66252

View file

@ -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];
}
}
}
?>