Prepare for automatic style sheet loading per page

This feature will be used in future development of the GUI
It allows pages to have their own style sheet settings stored in a related .css file
This commit is contained in:
bergware
2023-10-13 17:49:13 +02:00
parent a6d66e0a65
commit 5bd4280e83
@@ -738,6 +738,10 @@ foreach ($pages as $page) {
// create list of nchan scripts to be started
if (isset($page['Nchan'])) nchan_merge($page['root'], $page['Nchan']);
annotate($page['file']);
// include page specific stylesheet (if existing)
$css = "/{$page['root']}/styles/".strtolower($page['name']).".css";
if (is_file($docroot.$css)) echo '<link type="text/css" rel="stylesheet" href="',autov($css),'">',"\n";
// create page content
empty($page['Markdown']) || $page['Markdown']=='true' ? eval('?>'.Markdown(parse_text($page['text']))) : eval('?>'.parse_text($page['text']));
if ($close) echo "</div></div>";
}