Neubau Fundament + Startseite: Designsystem, PHP-Komponenten, Brevo-Formular, Instagram-Sync
- Ordnerstruktur mit public/-Docroot, Deny-.htaccess für app/bin/config/data/storage - CLAUDE.md mit Leitplanken (self-hosted only, Single Source of Truth, Component-first) - Design-Tokens aus alter Seite extrahiert (Akzent #e20612, Coolvetica/Abel als woff2) - Front Controller mit Routen-Register, Sitemap, Canonical, JSON-LD (SportsClub) - Startseite: Hero, Instagram-Feed (lokaler Cache), Historie/Sportheim, Stats, Partner, Kontakt - Kontaktformular via PHPMailer/Brevo mit Honeypot + HMAC-Time-Trap (kein reCAPTCHA) - bin/instagram-sync.php: Scraper mit Strategie-Kette, flock, atomarem Cache, lokalen Bildern Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
52
app/components/meta.php
Normal file
52
app/components/meta.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* <head>-Inhalt. Props: $meta (array aus der Page), $current (Slug).
|
||||
* $meta: title, description, og_image (optional, Pfad relativ zu assets/),
|
||||
* title_absolute (bool — Title ohne Suffix), scripts (array zusätzlicher JS-Dateien).
|
||||
*/
|
||||
$club = json_load('club');
|
||||
|
||||
$title = $meta['title'] ?? $club['name'];
|
||||
if (empty($meta['title_absolute'])) {
|
||||
$title .= ' | ' . $club['name'];
|
||||
}
|
||||
$description = $meta['description'] ?? $club['description'];
|
||||
$canonical = abs_url($current === '404' ? '' : $current);
|
||||
$ogImage = rtrim((string) config('base_url'), '/') . '/assets/' . ltrim($meta['og_image'] ?? 'img/og-default.jpg', '/');
|
||||
$scripts = array_merge(['nav.js'], $meta['scripts'] ?? []);
|
||||
?>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= e($title) ?></title>
|
||||
<meta name="description" content="<?= e($description) ?>">
|
||||
<?php if ($current !== '404'): ?>
|
||||
<link rel="canonical" href="<?= e($canonical) ?>">
|
||||
<?php else: ?>
|
||||
<meta name="robots" content="noindex">
|
||||
<?php endif; ?>
|
||||
<meta name="theme-color" content="#222222">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:site_name" content="<?= e($club['name']) ?>">
|
||||
<meta property="og:title" content="<?= e($title) ?>">
|
||||
<meta property="og:description" content="<?= e($description) ?>">
|
||||
<meta property="og:url" content="<?= e($canonical) ?>">
|
||||
<meta property="og:image" content="<?= e($ogImage) ?>">
|
||||
<meta property="og:locale" content="de_DE">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<link rel="icon" href="/favicon.ico" sizes="32x32">
|
||||
<link rel="icon" href="<?= e(asset('img/logo.svg')) ?>" type="image/svg+xml">
|
||||
<?php foreach (['fonts/coolvetica.woff2', 'fonts/abel.woff2'] as $font): ?>
|
||||
<?php if (is_file(PUBLIC_PATH . '/assets/' . $font)): ?>
|
||||
<link rel="preload" href="<?= e(asset($font)) ?>" as="font" type="font/woff2" crossorigin>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach (['tokens', 'reset', 'base', 'layout', 'components', 'utilities'] as $css): ?>
|
||||
<link rel="stylesheet" href="<?= e(asset("css/{$css}.css")) ?>">
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($scripts as $js): ?>
|
||||
<script defer src="<?= e(asset("js/{$js}")) ?>"></script>
|
||||
<?php endforeach; ?>
|
||||
<?php component('jsonld'); ?>
|
||||
Reference in New Issue
Block a user