-
Notifications
You must be signed in to change notification settings - Fork 14
/
component.php
54 lines (45 loc) · 1.62 KB
/
component.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* @package Lightning
*
* @copyright Copyright (C) 2020 JoomJunk. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/** @var Joomla\CMS\Document\HtmlDocument $this */
$wa = $this->getWebAssetManager();
// Load assets
$wa->usePreset('template.lightning')
->useStyle('template.lightning.user')
->useScript('template.lightning.user');
// Load switcher JS
// This should be loaded even if the themeSwitcher is disabled, so that the system preference will still dictate the theme
$wa->useScript('switch.js');
// Template params
$fontAwesome = (boolean)$this->params->get('font-awesome-thats-actually-rather-shit', 1);
$googleFont = $this->params->get('google-font', '');
// Google font
if ($googleFont !== '')
{
$fontFamily = str_replace(' ', '+', $googleFont);
$this->getPreloadManager()->preconnect('https://fonts.googleapis.com', ['crossorigin' => 'anonymous']);
$this->getPreloadManager()->preconnect('https://fonts.gstatic.com', ['crossorigin' => 'anonymous']);
$this->addHeadLink('https://fonts.googleapis.com/css2?family=' . $fontFamily . '&display=swap', 'stylesheet', 'rel');
$wa->addInlineStyle(':root {
--hiq-font-family-base: "' . $googleFont . '";
}');
}
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<jdoc:include type="metas" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<jdoc:include type="styles" />
<jdoc:include type="scripts" />
</head>
<body>
<jdoc:include type="message" />
<jdoc:include type="component" />
</body>
</html>