Add custom <head> feature

This commit is contained in:
dqos 2022-11-23 22:05:42 +01:00
parent 67fb411882
commit 0234c12e8a
3 changed files with 4 additions and 0 deletions

View file

@ -38,6 +38,7 @@ function exitNormal(): void
$templateData = [ $templateData = [
'title' => LG_TITLE, 'title' => LG_TITLE,
'custom_css' => LG_CSS_OVERRIDES, 'custom_css' => LG_CSS_OVERRIDES,
'custom_head' => LG_CUSTOM_HEAD,
'logo_url' => LG_LOGO_URL, 'logo_url' => LG_LOGO_URL,
'logo_data' => LG_LOGO, 'logo_data' => LG_LOGO,
// //

View file

@ -11,6 +11,8 @@ const LG_LOGO_URL = 'https://github.com/hybula/lookingglass/';
// Define a custom CSS file which can be used to style the LG, set false to disable, else point to the CSS file; // Define a custom CSS file which can be used to style the LG, set false to disable, else point to the CSS file;
const LG_CSS_OVERRIDES = false; const LG_CSS_OVERRIDES = false;
// Define <head> content, this could be JS, CSS or meta tags;
const LG_CUSTOM_HEAD = false;
// Enable or disable blocks/parts of the LG, set false to hide a part; // Enable or disable blocks/parts of the LG, set false to hide a part;
const LG_BLOCK_NETWORK = true; const LG_BLOCK_NETWORK = true;

View file

@ -89,6 +89,7 @@ $templateData['csrfToken'] = $_SESSION[LookingGlass::SESSION_CSRF] = bin2hex(ran
<title><?php echo $templateData['title'] ?></title> <title><?php echo $templateData['title'] ?></title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<?php if ($templateData['custom_css']) { echo '<link href="'.$templateData['custom_css'].'" rel="stylesheet">'; } ?> <?php if ($templateData['custom_css']) { echo '<link href="'.$templateData['custom_css'].'" rel="stylesheet">'; } ?>
<?php if ($templateData['custom_head']) { echo $templateData['custom_head']; } ?>
</head> </head>
<body> <body>