Story 3.2: router php urls

This commit is contained in:
2026-02-04 17:06:28 +01:00
parent d520fe848f
commit 0409bb1327
13 changed files with 253 additions and 34 deletions

23
pages/404.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
http_response_code(404);
$pageTitle = 'Page non trouvée';
$currentPage = '';
include_template('header', compact('pageTitle'));
include_template('navbar', compact('currentPage'));
?>
<main class="min-h-screen flex items-center justify-center">
<div class="container-content text-center py-20">
<h1 class="text-display text-primary mb-4">404</h1>
<p class="text-xl text-text-secondary mb-8">
Oups ! Cette page n'existe pas.
</p>
<a href="/" class="btn-primary">
Retour à l'accueil
</a>
</div>
</main>
<?php include_template('footer'); ?>

16
pages/about.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
$pageTitle = 'Me Découvrir';
$currentPage = 'about';
include_template('header', compact('pageTitle'));
include_template('navbar', compact('currentPage'));
?>
<main class="min-h-screen">
<div class="container-content py-20">
<h1 class="text-heading mb-4">Me Découvrir</h1>
<p class="text-text-secondary">Le parcours arrive bientôt.</p>
</div>
</main>
<?php include_template('footer'); ?>

16
pages/contact.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
$pageTitle = 'Contact';
$currentPage = 'contact';
include_template('header', compact('pageTitle'));
include_template('navbar', compact('currentPage'));
?>
<main class="min-h-screen">
<div class="container-content py-20">
<h1 class="text-heading mb-4">Contact</h1>
<p class="text-text-secondary">Le formulaire arrive bientôt.</p>
</div>
</main>
<?php include_template('footer'); ?>

24
pages/project-single.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
$currentPage = '';
$slug = $GLOBALS['routeParams'][0] ?? null;
$project = $slug ? getProjectBySlug($slug) : null;
if (!$project) {
http_response_code(404);
include __DIR__ . '/404.php';
exit;
}
$pageTitle = $project['title'] ?? 'Projet';
include_template('header', compact('pageTitle'));
include_template('navbar', compact('currentPage'));
?>
<main class="min-h-screen">
<div class="container-content py-20">
<h1 class="text-heading mb-4"><?= htmlspecialchars($project['title'], ENT_QUOTES, 'UTF-8') ?></h1>
<p class="text-text-secondary">Page projet en construction.</p>
</div>
</main>
<?php include_template('footer'); ?>

16
pages/projects.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
$pageTitle = 'Projets';
$currentPage = 'projects';
include_template('header', compact('pageTitle'));
include_template('navbar', compact('currentPage'));
?>
<main class="min-h-screen">
<div class="container-content py-20">
<h1 class="text-heading mb-4">Projets</h1>
<p class="text-text-secondary">La liste des projets arrive bientôt.</p>
</div>
</main>
<?php include_template('footer'); ?>

16
pages/skills.php Normal file
View File

@@ -0,0 +1,16 @@
<?php
$pageTitle = 'Compétences';
$currentPage = 'skills';
include_template('header', compact('pageTitle'));
include_template('navbar', compact('currentPage'));
?>
<main class="min-h-screen">
<div class="container-content py-20">
<h1 class="text-heading mb-4">Compétences</h1>
<p class="text-text-secondary">Le détail des compétences arrive bientôt.</p>
</div>
</main>
<?php include_template('footer'); ?>