temp/exemple.temp // Exécute le PHP vers du HTML ob_start(); require SITE . "/md/" . $pageId . ".md"; file_put_contents("temp/" . SITE . "/" . $pageId . ".temp", ob_get_contents()); ob_end_clean(); // temp/exemple.temp > temp2/exemple.temp2 // Compile le Markdown vers du HTML $contenuPage = file_get_contents("temp/" . SITE . "/" . $pageId . ".temp"); $Parsedown = new ParsedownExtraPlugin; $Parsedown = $Parsedown->setUrlsLinked(false); $Parsedown = $Parsedown->setMarkupEscaped(false); $Parsedown = $Parsedown->setBreaksEnabled(true); $contenuPage = $Parsedown->text($contenuPage); file_put_contents("temp/" . SITE . "/" . $pageId . ".temp2", $contenuPage); // temp2/exemple.temp2 > exemple.html // Ajoute header et footer au HTML ob_start(); $pageMetas = getPageMetas($pageId); require "inc/debut.php"; if ($pageMetas['type'] == "article") { echo "

" . $pageMetas['h1'] . "

"; echo "
"; } else if ($pageMetas['type'] == "centré") { echo "
"; } require "temp/" . SITE . "/" . $pageId . ".temp2"; if ($pageMetas['type'] == "article") { echo "
"; } else if ($pageMetas['type'] == "centré") { echo ""; } require "inc/footer.php"; file_put_contents(SITE . "/" . $pageId . ".html", ob_get_contents()); ob_end_clean(); } // exemple.html > exemple.html.gz // Compresse les fichiers textes statiques HTML & CSS exec('/usr/local/bin/static-compress -c zopfli "' . SITE . '/*.html" "' . SITE . '/*.js" "' . SITE . '/css/*.css"'); } else { exit("Must be run from CLI"); }