Refector code
This commit is contained in:
1 parent
6ab627ba60
commit
2fbbf4b0fc
23 files changed
+1518
-1069
No files matched your search
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* partials/head.php
|
||||
* -----------------
|
||||
* Everything inside <head>, driven entirely by config(). No station-specific
|
||||
* strings live here — change your .env, not this file.
|
||||
*/
|
||||
if (!defined('RADIO_CONFIG_LOADED')) { http_response_code(500); exit('config not loaded'); }
|
||||
|
||||
$siteName = cfg('site.name');
|
||||
$siteUrl = cfg('site.url');
|
||||
$ogImage = cfg('seo.og_image');
|
||||
$iconsDir = cfg('seo.icons_dir');
|
||||
?>
|
||||
<meta charset="utf-8"/>
|
||||
<title id="track-title"><?= e($siteName) ?></title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<meta name="description" content="<?= e(cfg('site.description')) ?>"/>
|
||||
<meta name="keywords" content="<?= e(cfg('site.keywords')) ?>"/>
|
||||
<?php if (cfg('site.author') !== ''): ?>
|
||||
<meta name="author" content="<?= e(cfg('site.author')) ?>"/>
|
||||
<?php endif; ?>
|
||||
<meta name="theme-color" content="<?= e(cfg('seo.theme_color')) ?>"/>
|
||||
<meta name="msapplication-TileColor" content="<?= e(cfg('seo.tile_color')) ?>"/>
|
||||
|
||||
<!-- Open Graph -->
|
||||
<meta property="og:title" content="<?= e($siteName) ?>"/>
|
||||
<meta property="og:type" content="website"/>
|
||||
<meta property="og:site_name" content="<?= e(cfg('site.short_name')) ?>"/>
|
||||
<meta property="og:description" content="<?= e(cfg('site.description')) ?>"/>
|
||||
<meta property="og:locale" content="<?= e(cfg('site.locale')) ?>"/>
|
||||
<?php if ($siteUrl !== '/'): ?>
|
||||
<meta property="og:url" content="<?= e($siteUrl) ?>"/>
|
||||
<?php endif; ?>
|
||||
<?php if ($ogImage !== ''): ?>
|
||||
<meta property="og:image" id="metaimage1" content="<?= e($ogImage) ?>"/>
|
||||
<?php endif; ?>
|
||||
<?php if (cfg('stream.url') !== ''): ?>
|
||||
<meta property="og:audio" content="<?= e(cfg('stream.url')) ?>"/>
|
||||
<meta property="og:audio:type" content="<?= e(cfg('stream.type')) ?>"/>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (cfg('seo.show_icons')): ?>
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="<?= e($iconsDir) ?>/apple-touch-icon.png"/>
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="<?= e($iconsDir) ?>/favicon-32x32.png"/>
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="<?= e($iconsDir) ?>/favicon-16x16.png"/>
|
||||
<link rel="manifest" href="<?= e($iconsDir) ?>/site.webmanifest"/>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Theme variables (from .env) -->
|
||||
<style>
|
||||
:root{
|
||||
--bg: <?= e(cfg('theme.bg')) ?>;
|
||||
--bg-mobile: <?= e(cfg('theme.bg_mobile')) ?>;
|
||||
--surface: <?= e(cfg('theme.surface')) ?>;
|
||||
--text: <?= e(cfg('theme.text')) ?>;
|
||||
--muted: <?= e(cfg('theme.muted')) ?>;
|
||||
--accent: <?= e(cfg('theme.accent')) ?>;
|
||||
--accent-hover: <?= e(cfg('theme.accent_hover')) ?>;
|
||||
--accent-text: <?= e(cfg('theme.accent_text')) ?>;
|
||||
--radius: <?= e(cfg('theme.radius')) ?>;
|
||||
--font: <?= cfg('theme.font') /* font stack, not user text */ ?>;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="assets/css/radio.css"/>
|
||||
|
||||
<?php if (cfg('analytics.matomo_url') !== '' && cfg('analytics.matomo_site_id') !== ''):
|
||||
$mUrl = rtrim(cfg('analytics.matomo_url'), '/') . '/'; ?>
|
||||
<!-- Matomo -->
|
||||
<script>
|
||||
var _paq = window._paq = window._paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u = "<?= e($mUrl) ?>";
|
||||
_paq.push(['setTrackerUrl', u + 'matomo.php']);
|
||||
_paq.push(['setSiteId', '<?= e(cfg('analytics.matomo_site_id')) ?>']);
|
||||
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
|
||||
g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s);
|
||||
})();
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
Reference in new issue
Block a user