Better indentation

This commit is contained in:
Miraty 2022-06-01 17:33:32 +02:00
parent 3ece3cbb71
commit afe82852f5
3 changed files with 234 additions and 239 deletions

View File

@ -4,7 +4,7 @@ mkht.php is a PHP script for building Gemini, Markdown and HTML/CSS sites from s
Place your pages tree in `/src/*/*.(gmi|md)`. Place your pages tree in `/src/*/*.(gmi|md)`.
Optionnal files: Optional files:
* `/config.ini` * `/config.ini`
* `/style.less` * `/style.less`
* `/logo.png` * `/logo.png`

View File

@ -182,10 +182,13 @@ foreach ($pages as $page) {
echo "<title>" . $config['siteTitle'] . "</title>"; echo "<title>" . $config['siteTitle'] . "</title>";
?> ?>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<?php if ($config['css']) { ?>
<link rel="stylesheet" media="screen" href="<?= $relativePathToRoot ?>css/<?= CSS_FILENAME ?>">
<?php } ?>
<?php <?php
if ($config['css']) {
?>
<link rel="stylesheet" media="screen" href="<?= $relativePathToRoot ?>css/<?= CSS_FILENAME ?>">
<?php
}
if (file_exists(SITE . "/head.inc.html")) if (file_exists(SITE . "/head.inc.html"))
echo file_get_contents(SITE . "/head.inc.html"); echo file_get_contents(SITE . "/head.inc.html");
?> ?>
@ -207,23 +210,15 @@ foreach ($pages as $page) {
</header> </header>
<?php <?php
} }
?>
<?php if ($config['centerIndex'] AND $pathParts['filename'] === "index")
if ($config['centerIndex'] AND $pathParts['filename'] === "index") { echo '<div class="centered">' . $pageContent . "</div>";
echo '<div class="centered">'; else
} else { echo "<main>" . $pageContent . "</main>";
echo "<main>";
}
echo $pageContent;
if ($config['centerIndex'] AND $pathParts['filename'] === "index") {
echo "</div>";
} else {
echo "</main>";
}
if (file_exists(SITE . "/end.inc.html")) if (file_exists(SITE . "/end.inc.html"))
require SITE . "/end.inc.html"; require SITE . "/end.inc.html";
echo "</body></html>"; echo "</body></html>";
file_put_contents($pathParts['dirname'] . "/" . $pathParts['filename'] . ".html", ob_get_contents()); file_put_contents($pathParts['dirname'] . "/" . $pathParts['filename'] . ".html", ob_get_contents());
ob_end_clean(); ob_end_clean();