137 lines
6.4 KiB
PHP
137 lines
6.4 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title><?= htmlspecialchars(($seoTitle ?? '') ?: ($title ?? 'varlog')) ?></title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<!-- SEO -->
|
|
<meta name="description" content="<?= htmlspecialchars(($seoDescription ?? '') ?: 'Varlog est un journal personnel en ligne de Cédrix. Informatique, hack et loisirs techniques.') ?>">
|
|
<meta name="robots" content="index, follow">
|
|
|
|
<!-- Open Graph -->
|
|
<meta property="og:title" content="<?= htmlspecialchars(($seoTitle ?? '') ?: ($title ?? 'varlog')) ?>">
|
|
<meta property="og:description" content="<?= htmlspecialchars(($seoDescription ?? '') ?: 'Découvrez les derniers articles publiés sur le journal personnel varlog.') ?>">
|
|
<meta property="og:type" content="<?= htmlspecialchars($ogType ?? 'website') ?>">
|
|
<meta property="og:locale" content="fr_FR">
|
|
<meta property="og:url" content="<?= htmlspecialchars($ogUrl ?? APP_URL) ?>">
|
|
<meta property="og:site_name" content="varlog">
|
|
<?php if (!empty($ogImage ?? '')): ?>
|
|
<meta property="og:image" content="<?= htmlspecialchars($ogImage) ?>">
|
|
<meta property="og:image:width" content="1200">
|
|
<meta property="og:image:height" content="630">
|
|
<?php endif; ?>
|
|
<?php if (!empty($articlePublishedAt ?? '')): ?>
|
|
<meta property="article:published_time" content="<?= htmlspecialchars(date('c', strtotime((string)$articlePublishedAt))) ?>">
|
|
<?php endif; ?>
|
|
|
|
<!-- RSS autodiscovery -->
|
|
<link rel="alternate" type="application/rss+xml" title="varlog" href="/feed">
|
|
|
|
<!-- Favicon -->
|
|
<link rel="icon" href="/assets/favicon.svg" type="image/svg+xml">
|
|
|
|
<!-- CSS -->
|
|
<link href="/assets/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="/assets/css/style.css">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<header>
|
|
<nav class="navbar navbar-expand-lg navbar-light mb-0" role="navigation" aria-label="Navigation principale">
|
|
<div class="container-fluid">
|
|
<a class="navbar-brand d-flex flex-column lh-1" href="/">
|
|
<span>varlog</span>
|
|
<small class="navbar-tagline">journal de Cédrix · informatique, hack & loisirs</small>
|
|
</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Basculer la navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarContent">
|
|
<?php
|
|
$_layoutAction = $_GET['action'] ?? 'list';
|
|
if (($_layoutAction === 'list' || $_layoutAction === '') && isset($articles)):
|
|
$_layoutPrivateCats = $articles->getPrivateCategories();
|
|
$_layoutCats = array_filter(
|
|
$articles->getCategories(),
|
|
function ($cat) use ($_layoutPrivateCats) {
|
|
return isLoggedIn() || !in_array($cat, $_layoutPrivateCats, true);
|
|
},
|
|
ARRAY_FILTER_USE_KEY
|
|
);
|
|
$_layoutCurrentCat = trim($_GET['cat'] ?? '');
|
|
if (!empty($_layoutCats)):
|
|
?>
|
|
<ul class="navbar-nav me-auto navbar-cats flex-nowrap overflow-auto gap-1">
|
|
<li class="nav-item">
|
|
<a class="nav-link nav-cat <?= $_layoutCurrentCat === '' ? 'active' : '' ?>" href="/">Tous</a>
|
|
</li>
|
|
<?php foreach ($_layoutCats as $catName => $catCount):
|
|
$isPriv = in_array($catName, $_layoutPrivateCats, true); ?>
|
|
<li class="nav-item">
|
|
<a class="nav-link nav-cat <?= $_layoutCurrentCat === $catName ? 'active' : '' ?>"
|
|
href="/?cat=<?= rawurlencode($catName) ?>">
|
|
<?= htmlspecialchars($catName) ?>
|
|
<?php if ($isPriv): ?><span class="ms-1" style="font-size:.65em;opacity:.6">🔒</span><?php endif; ?>
|
|
</a>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
<?php else: ?>
|
|
<ul class="navbar-nav me-auto"></ul>
|
|
<?php endif;
|
|
else: ?>
|
|
<ul class="navbar-nav me-auto"></ul>
|
|
<?php endif; ?>
|
|
<ul class="navbar-nav">
|
|
<?php if (function_exists('isLoggedIn') && isLoggedIn()): ?>
|
|
<li class="nav-item"><a class="nav-link" href="/?action=admin">Admin</a></li>
|
|
<?php endif; ?>
|
|
<?php if (function_exists('isLoggedIn') && isLoggedIn()): ?>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/?action=profile">
|
|
<?= htmlspecialchars(function_exists('currentUserName') ? currentUserName() : (currentUserEmail() ?? '')) ?>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link text-muted" href="/logout.php" title="Déconnexion">Déconnexion</a>
|
|
</li>
|
|
<?php else: ?>
|
|
<li class="nav-item"><a class="nav-link" href="/login">Connexion</a></li>
|
|
<?php endif; ?>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="<?= htmlspecialchars($mainClass ?? 'container') ?>" role="main">
|
|
<?= $content ?>
|
|
</main>
|
|
|
|
<footer class="py-5 mt-5" role="contentinfo">
|
|
<div class="container">
|
|
<div class="footer-inner">
|
|
<div class="footer-about">
|
|
<strong>varlog</strong>
|
|
<p>Journal personnel de Cédrix.<br>Informatique, hack et loisirs techniques.</p>
|
|
<small>© <?= date('Y') ?> — <a href="https://creativecommons.org/licenses/by/4.0/" target="_blank" rel="noopener">CC BY 4.0</a></small>
|
|
</div>
|
|
<nav class="footer-nav" aria-label="Liens du site">
|
|
<a href="/?action=about">À propos</a>
|
|
<a href="/?action=contact">Contact</a>
|
|
<a href="/?action=legal">Mentions légales</a>
|
|
<a href="/?action=licenses">Licences</a>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
<!-- JS -->
|
|
<script src="/assets/js/bootstrap.bundle.min.js"></script>
|
|
<script src="/assets/js/app.js"></script>
|
|
|
|
</body>
|
|
</html>
|