implemented step 15 by Gemini
- Rendering HTML
This commit is contained in:
87
src/Templates/base.php
Normal file
87
src/Templates/base.php
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
/**
|
||||
* @var array $project
|
||||
* @var string $content
|
||||
*/
|
||||
$seo = $project['content']['generated']['seo'] ?? [];
|
||||
$identity = $project['wizard_data']['identity'] ?? [];
|
||||
$contact = $project['wizard_data']['contact'] ?? [];
|
||||
$visuals = $project['wizard_data']['visuals'] ?? [];
|
||||
$assets = $project['wizard_data']['assets'] ?? [];
|
||||
|
||||
// Helper function for safe output
|
||||
if (!function_exists('e')) {
|
||||
function e($value) {
|
||||
return htmlspecialchars((string)($value ?? ''), ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="sk">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title><?= e($seo['title'] ?? $identity['business_name'] ?? 'Môj Web') ?></title>
|
||||
<meta name="description" content="<?= e($seo['description'] ?? '') ?>">
|
||||
|
||||
<!-- Open Graph -->
|
||||
<meta property="og:title" content="<?= e($seo['title'] ?? '') ?>">
|
||||
<meta property="og:description" content="<?= e($seo['description'] ?? '') ?>">
|
||||
<meta property="og:type" content="website">
|
||||
|
||||
<!-- Assets -->
|
||||
<link rel="stylesheet" href="assets/css/site.css">
|
||||
|
||||
<style>
|
||||
:root {
|
||||
<?php if (!empty($visuals['palette'])): ?>
|
||||
/* Palette overrides will go here in later steps */
|
||||
<?php endif; ?>
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<nav>
|
||||
<div class="container">
|
||||
<div class="logo">
|
||||
<?php if (!empty($assets['logo'])): ?>
|
||||
<img src="<?= e($assets['logo']) ?>" alt="<?= e($identity['business_name']) ?>">
|
||||
<?php else: ?>
|
||||
<strong><?= e($identity['business_name']) ?></strong>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<ul class="nav-links">
|
||||
<!-- Navigation will be dynamic in later steps -->
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main id="content">
|
||||
<?= $content ?>
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="footer-grid">
|
||||
<div class="footer-info">
|
||||
<h4><?= e($identity['business_name']) ?></h4>
|
||||
<p><?= e($identity['tagline']) ?></p>
|
||||
</div>
|
||||
<div class="footer-contact">
|
||||
<p><?= e($contact['email']) ?></p>
|
||||
<p><?= e($contact['phone']) ?></p>
|
||||
<p><?= e($contact['address']) ?>, <?= e($contact['city']) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-bottom">
|
||||
<p>© <?= date('Y') ?> <?= e($identity['business_name']) ?>. Všetky práva vyhradené.</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user