Files
xamxam/public/apropos.php
Pontoporeia 3a8ffa6afe Add Open Graph and Twitter Card meta tags to all public pages
- templates/public/head.php: add centralised OG/Twitter tag rendering via $ogTags array;
  supports type, title, description, url, image, image_alt, site_name, article_author,
  article_published_time; twitter:card switches between summary_large_image / summary
  based on presence of og:image

- public/tfe.php: populate full article OG tags — og:type=article, canonical URL,
  og:image resolved from banner_path → first image file in thesis_files → omitted,
  og:image:alt, article:author, article:published_time (year-01-01); twitter:card
  summary_large_image when image present

- public/index.php, search.php, apropos.php, licence.php: add basic og:type=website
  tags (title, description, canonical url, site_name)

Sharing a thesis link on Slack, WhatsApp, iMessage, or any social platform will now
render a rich preview card with the thesis title, synopsis excerpt, and cover/banner image.
2026-03-29 15:43:21 +02:00

103 lines
4.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
require_once __DIR__ . '/../config/bootstrap.php';
require_once APP_ROOT . '/src/Database.php';
require_once APP_ROOT . '/src/Parsedown.php';
$currentNav = 'apropos';
// Fallback static content used when DB content is the placeholder
define('APROPOS_STATIC_CONTENT', "Ce site POSTERG a été créé pour répertorier et valoriser les mémoires de l'erg École de Recherches Graphique de Bruxelles.\n\nL'objectif est à la fois d'offrir une vitrine aux projets des anciens étudiantes et de mettre en lumière la diversité des disciplines et des parcours qui façonnent l'histoire de l'école à travers les âges, depuis près de 100 ans.");
try {
$db = Database::getInstance();
$aboutPage = $db->getPage('about');
$rawContent = $aboutPage ? $aboutPage['content'] : '';
// Use static fallback if content is placeholder
if (empty(trim($rawContent)) || trim($rawContent) === 'Contenu à venir') {
$rawContent = APROPOS_STATIC_CONTENT;
}
} catch (Exception $e) {
error_log("Error loading about page: " . $e->getMessage());
$rawContent = APROPOS_STATIC_CONTENT;
}
$pd = new Parsedown();
$pd->setSafeMode(true);
$aboutHtml = $pd->text($rawContent);
$pageTitle = 'À Propos Posterg';
$metaDescription = 'À propos de Posterg, le répertoire des mémoires de fin d\'études de l\'erg École de Recherches Graphiques de Bruxelles.';
$ogTags = [
'type' => 'website',
'title' => $pageTitle,
'description' => $metaDescription,
'url' => 'https://posterg.erg.be/apropos.php',
'site_name' => 'Posterg 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-layout">
<!-- LEFT: main text (from DB, Markdown-rendered) -->
<div class="apropos-left">
<div class="apropos-description apropos-page-content">
<?= $aboutHtml ?>
</div>
</div>
<!-- RIGHT: links, contacts, credits -->
<div class="apropos-right">
<div>
<h2 class="apropos-section-title">
<a href="https://erg.be" target="_blank" rel="noopener">Site de l'erg</a>
</h2>
</div>
<div>
<h2 class="apropos-section-title">Contacts</h2>
<div class="apropos-contact">
<span class="apropos-contact-name">Laurent Leprince</span>
<span class="apropos-contact-role">Bibliothèque d'architecture, d'ingénierie architecturale, d'urbanisme (BAIU) :</span>
<span class="apropos-contact-email">laurent.leprince@uclouvain.be</span>
</div>
<div class="apropos-contact">
<span class="apropos-contact-name">Xavier Gorgol</span>
<span class="apropos-contact-role">Responsable des mémoires de l'ERG :</span>
<span class="apropos-contact-email">xavier.gorgol@erg.be</span>
</div>
<div class="apropos-contact">
<span class="apropos-contact-name">Brigitte Ledune</span>
<span class="apropos-contact-role">Cours de suivi de mémoire :</span>
<span class="apropos-contact-email">brigitte.ledune@erg.be</span>
</div>
</div>
<div>
<h2 class="apropos-section-title">Crédits</h2>
<p class="apropos-credits-text">
Design &amp; développement : Olivia Marly, Théophile Gerveau-Mercie &amp; Théo Hennequin
</p>
<p class="apropos-credits-text">
Typographies : Ductus (Amélie Dumont) &amp; BBB DM Sans
</p>
</div>
</div>
</div>
</main>
</body>
</html>