Files
xamxam/templates/public/head.php
Pontoporeia 338782947c chore: vendor all CDN assets locally; reorganise assets into css/ and js/
All third-party assets are now self-hosted — zero external requests at runtime.

CSS (assets/css/):
  - modern-normalize.min.css  (was assets/)
  - common.css, admin.css, main.css, search.css, tfe.css, apropos.css  (was assets/)
  - easymde.min.css 2.20.0  (was cdn.jsdelivr.net)
  - font-awesome.min.css 4.7.0  (was maxcdn.bootstrapcdn.com; injected at runtime by EasyMDE)

JS (assets/js/):
  - easymde.min.js 2.20.0  (was cdn.jsdelivr.net)

Fonts (assets/fonts/fontawesome/):
  - fontawesome-webfont.{eot,woff2,woff,ttf,svg}, FontAwesome.otf 4.7.0

Path fixes:
  - common.css @font-face: ./fonts/ -> ../fonts/ (one level deeper)
  - font-awesome.min.css @font-face: ../fonts/ -> ../fonts/fontawesome/ (dedicated subdir)
  - pages-edit.php: autoDownloadFontAwesome:false added to EasyMDE init to
    suppress the runtime CDN injection that was still present inside easymde.min.js

Reference updates (all now absolute /assets/css/* or /assets/js/*):
  - templates/public/head.php: modern-normalize + common
  - templates/admin/head.php: modern-normalize + admin
  - public/admin/login.php: modern-normalize + admin (standalone head)
  - public/index.php, tfe.php, search.php, apropos.php, licence.php: extraCss paths
  - public/admin/pages-edit.php: extraCss + extraJs (font-awesome, easymde CSS/JS)

Nginx static-file location already covers .css/.js/.woff/.woff2/.ttf/.otf with
30-day cache headers — no nginx config change needed.
2026-03-31 15:44:48 +02:00

67 lines
3.4 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.
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= htmlspecialchars($pageTitle ?? 'Posterg') ?></title>
<?php if (!empty($metaDescription)): ?>
<meta name="description" content="<?= htmlspecialchars($metaDescription) ?>">
<?php endif; ?>
<?php
// Open Graph / Twitter Card tags — populated per-page via $ogTags array.
// Keys: type, title, description, url, image, image_alt, site_name, article_author, article_published_time
if (!empty($ogTags)):
$ogType = $ogTags['type'] ?? 'website';
$ogTitle = $ogTags['title'] ?? ($pageTitle ?? 'Posterg');
$ogDescription = $ogTags['description'] ?? ($metaDescription ?? '');
$ogUrl = $ogTags['url'] ?? '';
$ogImage = $ogTags['image'] ?? '';
$ogImageAlt = $ogTags['image_alt'] ?? $ogTitle;
$ogSiteName = $ogTags['site_name'] ?? 'Posterg ERG';
?>
<meta property="og:type" content="<?= htmlspecialchars($ogType) ?>">
<meta property="og:site_name" content="<?= htmlspecialchars($ogSiteName) ?>">
<meta property="og:title" content="<?= htmlspecialchars($ogTitle) ?>">
<?php if (!empty($ogDescription)): ?>
<meta property="og:description" content="<?= htmlspecialchars($ogDescription) ?>">
<?php endif; ?>
<?php if (!empty($ogUrl)): ?>
<meta property="og:url" content="<?= htmlspecialchars($ogUrl) ?>">
<?php endif; ?>
<?php if (!empty($ogImage)): ?>
<meta property="og:image" content="<?= htmlspecialchars($ogImage) ?>">
<meta property="og:image:alt" content="<?= htmlspecialchars($ogImageAlt) ?>">
<?php endif; ?>
<?php if (!empty($ogTags['article_author'])): ?>
<meta property="article:author" content="<?= htmlspecialchars($ogTags['article_author']) ?>">
<?php endif; ?>
<?php if (!empty($ogTags['article_published_time'])): ?>
<meta property="article:published_time" content="<?= htmlspecialchars($ogTags['article_published_time']) ?>">
<?php endif; ?>
<meta name="twitter:card" content="<?= !empty($ogImage) ? 'summary_large_image' : 'summary' ?>">
<meta name="twitter:title" content="<?= htmlspecialchars($ogTitle) ?>">
<?php if (!empty($ogDescription)): ?>
<meta name="twitter:description" content="<?= htmlspecialchars($ogDescription) ?>">
<?php endif; ?>
<?php if (!empty($ogImage)): ?>
<meta name="twitter:image" content="<?= htmlspecialchars($ogImage) ?>">
<meta name="twitter:image:alt" content="<?= htmlspecialchars($ogImageAlt) ?>">
<?php endif; ?>
<?php endif; ?>
<link rel="icon" type="image/svg+xml" href="/assets/admin_favicon.svg">
<link rel="stylesheet" href="/assets/css/modern-normalize.min.css">
<link rel="stylesheet" href="/assets/css/common.css">
<?php foreach ($extraCss ?? [] as $css): ?>
<link rel="stylesheet" href="<?= htmlspecialchars($css) ?>">
<?php endforeach; ?>
<?php if (php_sapi_name() === 'cli-server'): ?>
<script>
(function poll(){
fetch('/live-reload.php').then(r=>r.json()).then(d=>{
if(d.changed) location.reload(); else setTimeout(poll,1000);
}).catch(()=>setTimeout(poll,2000));
})();
</script>
<?php endif; ?>
</head>