loadTemplate('public/generic'); $page_md = array(); $parser = new Doctrine\RST\Parser(); $fname = "{$cwd}/generic/{$page}.rst"; if (!file_exists($fname)) { page_not_found(); } $handle = fopen($fname, "r"); $page_md['ROOT_URL'] = $iap_root; $page_md['content'] = $parser->parse(fread($handle, filesize($fname)))->render(); $page_md['other_scripts'] = [WebpackBuiltFiles::$jsFiles['code']]; //$page_md['boot_script'] = "gl.code.runCode();"; fclose($handle); header('Content-Type: text/html; charset=utf-8'); echo $tpl->render($page_md);