You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ygdc/site/snippets/header.php

43 lines
1.1 KiB

2 months ago
<?php if (isset($json) && $json != []) {
$kirby->response()->type('application/json');
header("Content-Type: application/json");
echo json_encode($json);
exit();
}?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>YGDC - <?= $title ?></title>
<link rel="stylesheet" href="<?= asset("assets/css/style.min.css") ?>">
<script type="importmap">
{
"imports": {
"vue": "<?= asset("assets/js/vue.esm-browser.js") ?>"
}
}
</script>
<script>
class InjectSVG extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
fetch(this.getAttribute('src'))
.then(response => response.text())
.then(text => {
this.innerHTML = text;
});
}
}
customElements.define('inject-svg', InjectSVG);
</script>
<?php if ($site->url() == $page->url()): ?>
<script type="text/javascript">
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./sw.js');
}
</script>
<?php endif; ?>
</head>