mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
- templates/public/head.php: emit <meta name="description"> when $metaDescription is set - index.php: title → 'Posterg – Mémoires de l\'ERG'; description = site blurb - tfe.php: title → '[Titre] – [Auteur] – Posterg'; description = synopsis excerpt (strip_tags, truncate 160) - search.php: description = répertoire purpose blurb - apropos.php: description = about-page blurb - licence.php: description = licences blurb Fixes WCAG 2.4.2 (Page Titled) for index.php and tfe.php. All descriptions properly htmlspecialchars-escaped at render time.
46 lines
1.4 KiB
PHP
46 lines
1.4 KiB
PHP
<?php
|
||
require_once __DIR__ . '/../config/bootstrap.php';
|
||
require_once APP_ROOT . '/src/Database.php';
|
||
require_once APP_ROOT . '/src/Parsedown.php';
|
||
|
||
$currentNav = 'licence';
|
||
|
||
try {
|
||
$db = Database::getInstance();
|
||
$dbPage = $db->getPage('licenses');
|
||
$content = $dbPage ? $dbPage['content'] : '';
|
||
$licencePageTitle = $dbPage ? $dbPage['title'] : 'Licences';
|
||
} catch (Exception $e) {
|
||
error_log("Error loading licence page: " . $e->getMessage());
|
||
$content = '';
|
||
$licencePageTitle = 'Licences';
|
||
}
|
||
|
||
$pd = new Parsedown();
|
||
$pd->setSafeMode(true);
|
||
$html = $pd->text($content);
|
||
|
||
$pageTitle = $licencePageTitle . ' – Posterg';
|
||
$metaDescription = 'Informations sur les licences d\'utilisation des mémoires publiés sur Posterg, le répertoire des TFE de l\'erg.';
|
||
$extraCss = ['assets/apropos.css'];
|
||
?>
|
||
<?php include APP_ROOT . '/templates/public/head.php'; ?>
|
||
<body class="apropos-body">
|
||
<a href="#main-content" class="skip-link">Aller au contenu principal</a>
|
||
|
||
<?php include APP_ROOT . '/templates/nav.php'; ?>
|
||
<?php include APP_ROOT . '/templates/search-bar.php'; ?>
|
||
|
||
<main class="apropos-main" id="main-content">
|
||
<div class="apropos-description apropos-page-content apropos-single">
|
||
<?php if (!empty(trim($content))): ?>
|
||
<?= $html ?>
|
||
<?php else: ?>
|
||
<p>Contenu à venir.</p>
|
||
<?php endif; ?>
|
||
</div>
|
||
</main>
|
||
|
||
</body>
|
||
</html>
|