8
0
daux.io/templates/layout/00_layout.php

71 Zeilen
2.8 KiB
PHP

2015-04-23 10:24:50 +02:00
<!DOCTYPE html>
<html class="no-js" lang="<?=$config->getLanguage() ?>">
2015-04-23 10:24:50 +02:00
<head>
<title><?= $page['title']; ?> <?= ($page['title'] != $config->getTitle()) ? '- ' . $config->getTitle() : "" ?></title>
<?php //SEO meta tags...
if (array_key_exists('attributes', $page) && array_key_exists('description', $page['attributes'])) {
echo " <meta name=\"description\" content=\"{$page['attributes']['description']}\">\n";
} elseif ($config->hasTagline()) {
echo " <meta name=\"description\" content=\"{$config->getTagline()}\">\n";
}
if (array_key_exists('attributes', $page) && array_key_exists('keywords', $page['attributes'])) {
echo " <meta name=\"keywords\" content=\"{$page['attributes']['keywords']}\">\n";
}
if (array_key_exists('attributes', $page) && array_key_exists('author', $page['attributes'])) {
echo " <meta name=\"author\" content=\"{$page['attributes']['author']}\">\n";
} elseif ($config->hasAuthor()) {
echo " <meta name=\"author\" content=\"{$config->getAuthor()}\">\n";
}
?>
2015-04-23 10:24:50 +02:00
<meta charset="UTF-8">
2017-10-19 21:20:58 +02:00
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" href="<?= $config->getTheme()->getFavicon(); ?>" type="image/x-icon">
2017-10-19 21:20:58 +02:00
2015-04-23 10:24:50 +02:00
<!-- Mobile -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- JS -->
<script>
window.base_url = "<?php echo $base_url?>";
document.documentElement.classList.remove('no-js');
</script>
2015-04-23 10:24:50 +02:00
<!-- Font -->
<?php foreach ($config->getTheme()->getFonts() as $font) {
2020-04-22 21:55:53 +02:00
echo "<link href='$font' rel='stylesheet' type='text/css'>";
} ?>
2015-04-23 10:24:50 +02:00
<!-- CSS -->
<?php foreach ($config->getTheme()->getCSS() as $css) {
2020-04-22 21:55:53 +02:00
echo "<link href='$css' rel='stylesheet' type='text/css'>";
} ?>
2015-04-23 10:24:50 +02:00
<?php if ($config->getHTML()->hasSearch()) { ?>
<!-- Search -->
<link href="<?= $base_url; ?>daux_libraries/search.css" rel="stylesheet">
2017-10-19 21:20:58 +02:00
<?php } ?>
2015-04-23 10:24:50 +02:00
</head>
<body class="<?= $this->section('classes'); ?>">
2015-04-23 10:24:50 +02:00
<?= $this->section('content'); ?>
2015-07-20 15:59:52 +02:00
<?php
if ($config->getHTML()->hasGoogleAnalytics()) {
$this->insert('theme::partials/google_analytics', ['analytics' => $config->getHTML()->getGoogleAnalyticsId(), 'host' => $config->hasHost() ? $config->getHost() : '']);
2015-07-20 15:59:52 +02:00
}
if ($config->getHTML()->hasPiwikAnalytics()) {
$this->insert('theme::partials/piwik_analytics', ['url' => $config->getHTML()->getPiwikAnalyticsUrl(), 'id' => $config->getHTML()->getPiwikAnalyticsId()]);
2015-07-20 15:59:52 +02:00
}
?>
2015-04-23 10:24:50 +02:00
<!-- JS -->
<?php foreach ($config->getTheme()->getJS() as $js) {
2015-07-20 15:59:52 +02:00
echo '<script src="' . $js . '"></script>';
} ?>
2015-04-23 10:24:50 +02:00
2019-09-09 19:56:14 +02:00
<?php $this->insert('theme::partials/search_script', ['page' => $page, 'base_url' => $base_url]); ?>
2015-04-23 10:24:50 +02:00
</body>
</html>