, with date-and-title as #id. // !!! /////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // DO NOT TOUCH anything below here unless you know what you're doing. // Most basic use cases won't need to change anything here. // /////////////////////////////////////////////////////////////////////////////////////////////////////////////// // !!! // Include custom site configurations include($_SERVER['DOCUMENT_ROOT'].'_phpetite/_config.php'); include($_SERVER['DOCUMENT_ROOT'].'_phpetite/system.php'); // $site_info takes all page content from /content/_pages/home-content.md $site_info = '
' . $parsedown->text(file_get_contents('content/_pages/home-content.md')) .'
'; $cssFiles = array( "style.css" ); $updated_date = date("F j, Y"); $base_64_favicon = base64_encode(file_get_contents($site_icon)); $buffer = ""; foreach ($cssFiles as $cssFile) { $buffer .= file_get_contents($cssFile); } $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer); $buffer = str_replace(': ', ':', $buffer); $buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer); // Decide whether or not to display the site info on homepage if ($site_info != '') { $show_site_info = $site_info . '
'; } else { $show_site_info = ''; } $html = << $site_title

$site_title

$posts $pages
$show_site_info
EOD; if ($images_to_base64 == true) { $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML(html_entity_decode($html, ENT_QUOTES | ENT_HTML5, 'UTF-8')); libxml_clear_errors(); $post_images = $dom->getElementsByTagName('img'); foreach ($post_images as $image) { $src = $image->getAttribute('src'); $type = pathinfo($src, PATHINFO_EXTENSION); $data = file_get_contents($src); $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data); $image->setAttribute("src", $base64); } $html = $dom->saveHTML(); echo $html; } else { echo $html; } ?>