|
@@ -1,8 +1,9 @@
|
|
|
<?php
|
|
<?php
|
|
|
/**
|
|
/**
|
|
|
* Shared HTML fragments for the public site and the admin backoffice.
|
|
* Shared HTML fragments for the public site and the admin backoffice.
|
|
|
- * Public pages sit in the document root and admin pages in admin/, so asset
|
|
|
|
|
- * paths differ: public pages use 'assets/...', admin pages use '../assets/...'.
|
|
|
|
|
|
|
+ * Admin pages all sit in admin/ and hardcode '../assets/...'. Public pages sit
|
|
|
|
|
+ * in the document root except the gallery viewer in gallery/, so they prefix
|
|
|
|
|
+ * their links with base() — '' or '../' depending on the page (see bootstrap).
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
declare(strict_types=1);
|
|
@@ -11,21 +12,22 @@ function public_header(string $title, string $active = '', string $bodyClass = '
|
|
|
{
|
|
{
|
|
|
$site = site_get();
|
|
$site = site_get();
|
|
|
$name = $site['intro_title'] ?: config('site.name', 'Portfolio');
|
|
$name = $site['intro_title'] ?: config('site.name', 'Portfolio');
|
|
|
|
|
+ $base = base();
|
|
|
?><!DOCTYPE html>
|
|
?><!DOCTYPE html>
|
|
|
<html lang="en">
|
|
<html lang="en">
|
|
|
<head>
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
<meta charset="utf-8">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
<title><?= e($title) ?></title>
|
|
<title><?= e($title) ?></title>
|
|
|
-<link rel="stylesheet" href="assets/site.css">
|
|
|
|
|
|
|
+<link rel="stylesheet" href="<?= e($base) ?>assets/site.css">
|
|
|
</head>
|
|
</head>
|
|
|
<body class="<?= e($bodyClass) ?>">
|
|
<body class="<?= e($bodyClass) ?>">
|
|
|
<header class="nav" id="nav">
|
|
<header class="nav" id="nav">
|
|
|
- <a class="nav-brand" href="./"><?= e($name) ?></a>
|
|
|
|
|
|
|
+ <a class="nav-brand" href="<?= e($base ?: './') ?>"><?= e($name) ?></a>
|
|
|
<nav class="nav-links">
|
|
<nav class="nav-links">
|
|
|
- <a href="./" class="<?= $active === 'home' ? 'active' : '' ?>">Home</a>
|
|
|
|
|
- <a href="showreel.php" class="<?= $active === 'showreel' ? 'active' : '' ?>">Showreel</a>
|
|
|
|
|
- <a href="contact.php" class="<?= $active === 'contact' ? 'active' : '' ?>">Contact</a>
|
|
|
|
|
|
|
+ <a href="<?= e($base ?: './') ?>" class="<?= $active === 'home' ? 'active' : '' ?>">Home</a>
|
|
|
|
|
+ <a href="<?= e($base) ?>showreel.php" class="<?= $active === 'showreel' ? 'active' : '' ?>">Showreel</a>
|
|
|
|
|
+ <a href="<?= e($base) ?>contact.php" class="<?= $active === 'contact' ? 'active' : '' ?>">Contact</a>
|
|
|
</nav>
|
|
</nav>
|
|
|
</header>
|
|
</header>
|
|
|
<?php
|
|
<?php
|
|
@@ -33,14 +35,15 @@ function public_header(string $title, string $active = '', string $bodyClass = '
|
|
|
|
|
|
|
|
function public_footer(): void
|
|
function public_footer(): void
|
|
|
{
|
|
{
|
|
|
|
|
+ $base = base();
|
|
|
?><footer class="footer">
|
|
?><footer class="footer">
|
|
|
<nav class="footer-links">
|
|
<nav class="footer-links">
|
|
|
- <a href="impressum.php">Impressum</a>
|
|
|
|
|
- <a href="datenschutz.php">Datenschutz</a>
|
|
|
|
|
|
|
+ <a href="<?= e($base) ?>impressum.php">Impressum</a>
|
|
|
|
|
+ <a href="<?= e($base) ?>datenschutz.php">Datenschutz</a>
|
|
|
</nav>
|
|
</nav>
|
|
|
<span>© <?= date('Y') ?> <?= e(site_get()['intro_title'] ?: config('site.name', '')) ?></span>
|
|
<span>© <?= date('Y') ?> <?= e(site_get()['intro_title'] ?: config('site.name', '')) ?></span>
|
|
|
</footer>
|
|
</footer>
|
|
|
-<script src="assets/site.js"></script>
|
|
|
|
|
|
|
+<script src="<?= e($base) ?>assets/site.js"></script>
|
|
|
</body>
|
|
</body>
|
|
|
</html>
|
|
</html>
|
|
|
<?php
|
|
<?php
|