Files
2026-05-19 21:36:23 -04:00

46 lines
2.0 KiB
PHP

<?php
$title = 'Links';
$description = 'A collection of interesting and useful websites.';
include $_SERVER['DOCUMENT_ROOT'] . '/includes/head.php';
$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/assets/data/links.json'), true);
$categories = $data['categories'] ?? [];
?>
<body class="bg-[#0a0a0a] text-white min-h-screen">
<?php include $_SERVER['DOCUMENT_ROOT'] . '/includes/nav.php'; ?>
<main class="pt-16">
<div class="max-w-3xl mx-auto px-4 sm:px-6 py-12">
<h1 class="text-2xl font-semibold mb-6">Links</h1>
<p class="text-neutral-300 text-lg mb-16 text-center">A collection of interesting and useful websites.</p>
<div class="space-y-12">
<?php foreach ($categories as $cat): ?>
<section>
<h2 class="text-base text-neutral-300 uppercase tracking-widest mb-5"><?= htmlspecialchars($cat['name']) ?></h2>
<ul class="space-y-4">
<?php foreach ($cat['links'] as $link):
$domain = preg_replace('/^www\./', '', parse_url($link['url'], PHP_URL_HOST));
?>
<li>
<a href="<?= htmlspecialchars($link['url']) ?>" target="_blank" rel="noopener" class="group">
<span class="flex items-baseline gap-2">
<span class="text-neutral-300 text-base group-hover:text-white transition-colors"><?= htmlspecialchars($link['title']) ?></span>
<span class="text-neutral-400 text-base"><?= $domain ?></span>
</span>
<?php if (!empty($link['note'])): ?>
<span class="block text-neutral-400 text-base mt-0.5"><?= htmlspecialchars($link['note']) ?></span>
<?php endif; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</section>
<?php endforeach; ?>
</div>
</div>
</main>
</body>
</html>