configs
This commit is contained in:
@@ -38,6 +38,41 @@ $host = $_SERVER['HTTP_HOST'] ?? '';
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Montserrat:wght@600;700;800&display=swap" rel="stylesheet">
|
||||
<?php
|
||||
// CSS im Header
|
||||
foreach ($GLOBALS['page_styles'] as $style) {
|
||||
if ($style['pos'] !== 'header') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$href = $style['href'];
|
||||
if (!empty($style['version'])) {
|
||||
$href .= (str_contains($href, '?') ? '&' : '?') . 'v=' . urlencode($style['version']);
|
||||
}
|
||||
|
||||
echo '<link rel="stylesheet" href="' . htmlspecialchars($href) . '">' . PHP_EOL;
|
||||
}
|
||||
|
||||
// Scripts im Header
|
||||
foreach ($GLOBALS['page_header_scripts'] as $script) {
|
||||
$src = $script['src'];
|
||||
if (!empty($script['version'])) {
|
||||
$src .= (str_contains($src, '?') ? '&' : '?') . 'v=' . urlencode($script['version']);
|
||||
}
|
||||
|
||||
$attr = '';
|
||||
if ($script['async']) {
|
||||
$attr .= ' async';
|
||||
} elseif ($script['defer']) {
|
||||
$attr .= ' defer';
|
||||
}
|
||||
if ($script['type']) {
|
||||
$attr .= ' type="' . htmlspecialchars($script['type']) . '"';
|
||||
}
|
||||
|
||||
echo '<script src="' . htmlspecialchars($src) . '"' . $attr . '></script>' . PHP_EOL;
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- Tailwind (Dev) -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
Reference in New Issue
Block a user