39865-vm/insight.php
Flatlogic Bot d5ac0af598 beta
2026-05-01 21:45:54 +00:00

92 lines
3.2 KiB
PHP

<?php
declare(strict_types=1);
require_once __DIR__ . '/includes/site.php';
$slug = isset($_GET['slug']) ? trim((string) $_GET['slug']) : '';
$article = insight_by_slug($slug);
if (!$article) {
http_response_code(404);
$pageTitle = 'Article not found';
$pageDescription = 'The requested insight article could not be found.';
$activeNav = 'insights';
require __DIR__ . '/partials/header.php';
?>
<main>
<section class="section-shell">
<div class="container">
<div class="empty-state empty-state--page">
<h1>Insight not found</h1>
<p>The article you requested is unavailable. You can return to the insights overview and pick another piece.</p>
<a class="btn btn-primary" href="/insights.php">Back to insights</a>
</div>
</div>
</section>
</main>
<?php
require __DIR__ . '/partials/footer.php';
exit;
}
$pageTitle = $article['title'];
$pageDescription = $article['excerpt'];
$activeNav = 'insights';
require __DIR__ . '/partials/header.php';
?>
<main>
<section class="section-shell border-bottom page-hero">
<div class="container">
<a class="crumb-link" href="/insights.php">← Back to insights</a>
<div class="row g-4 align-items-end mt-2">
<div class="col-lg-8">
<span class="eyebrow"><?= htmlspecialchars($article['category']) ?></span>
<h1 class="section-title"><?= htmlspecialchars($article['title']) ?></h1>
<p class="section-copy mb-0"><?= htmlspecialchars($article['excerpt']) ?></p>
</div>
<div class="col-lg-4">
<div class="surface-panel compact-panel h-100">
<div class="content-row mb-0">
<h3>Published</h3>
<p><?= htmlspecialchars(format_display_date($article['published'])) ?> · <?= htmlspecialchars($article['read_time']) ?></p>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="section-shell border-bottom">
<div class="container">
<div class="row g-4">
<div class="col-lg-4">
<div class="surface-panel h-100">
<div class="panel-label">Key takeaways</div>
<ul class="list-unstyled service-points mb-0">
<?php foreach ($article['takeaways'] as $takeaway): ?>
<li><?= htmlspecialchars($takeaway) ?></li>
<?php endforeach; ?>
</ul>
</div>
</div>
<div class="col-lg-8">
<article class="surface-panel article-panel h-100">
<?php foreach ($article['sections'] as $section): ?>
<section class="article-section">
<h2><?= htmlspecialchars($section['heading']) ?></h2>
<p><?= htmlspecialchars($section['body']) ?></p>
</section>
<?php endforeach; ?>
<div class="quote-panel mt-4">
<p>Want to apply this thinking to a live roadmap?</p>
<a class="btn btn-primary" href="/contact.php">Start a project brief</a>
</div>
</article>
</div>
</div>
</div>
</section>
</main>
<?php require __DIR__ . '/partials/footer.php'; ?>