42 lines
1.5 KiB
PHP
42 lines
1.5 KiB
PHP
<?php
|
|
require_once 'includes/config.php';
|
|
require_once 'includes/stories.php';
|
|
|
|
$config = Config::load();
|
|
$stories = Stories::getAll();
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title><?= htmlspecialchars($config['site']['name']) ?></title>
|
|
<?php if (file_exists(__DIR__ . '/assets/images/site/favicon.png')): ?>
|
|
<link rel="icon" type="image/png" href="assets/images/site/favicon.png">
|
|
<?php endif; ?>
|
|
<link rel="stylesheet" href="assets/css/style.css">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<?php if (!empty($config['site']['logo'])): ?>
|
|
<img src="<?= htmlspecialchars($config['site']['logo']) ?>"
|
|
alt="<?= htmlspecialchars($config['site']['name']) ?>">
|
|
<?php endif; ?>
|
|
<h1><?= htmlspecialchars($config['site']['name']) ?></h1>
|
|
<p><?= htmlspecialchars($config['site']['description']) ?></p>
|
|
</header>
|
|
|
|
<main>
|
|
<div class="stories-grid">
|
|
<?php foreach ($stories as $story): ?>
|
|
<article class="story-card">
|
|
<img src="<?= htmlspecialchars($story['cover']) ?>" alt="">
|
|
<h2><?= htmlspecialchars($story['title']) ?></h2>
|
|
<p><?= htmlspecialchars($story['description']) ?></p>
|
|
<a href="story.php?id=<?= htmlspecialchars($story['id']) ?>">Lire</a>
|
|
</article>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</main>
|
|
</body>
|
|
</html>
|