getPrivateCategories(); $Parsedown = new Parsedown(); $now = time(); $base = rtrim(APP_URL, '/'); $all = array_values(array_filter( $articles->getAll(publishedOnly: true), static function (array $a) use ($now, $privateCats): bool { if (strtotime((string)($a['published_at'] ?? '')) > $now) { return false; } $cat = trim($a['category'] ?? ''); return $cat === '' || !in_array($cat, $privateCats, true); } )); // ─── Pagination curseur ────────────────────────────────────────────────────── $after = trim($_GET['after'] ?? ''); $offset = 0; if ($after !== '') { foreach ($all as $i => $a) { if ($a['uuid'] === $after) { $offset = $i + 1; break; } } } $items = array_slice($all, $offset, FEED_PAGE_SIZE); $nextCursor = (count($all) > $offset + FEED_PAGE_SIZE) ? ($all[$offset + FEED_PAGE_SIZE - 1]['uuid'] ?? null) : null; $feedUrl = $base . '/feed'; $feedNextUrl = $nextCursor !== null ? $base . '/feed/' . $nextCursor : null; // ─── lastBuildDate ─────────────────────────────────────────────────────────── $lastBuild = ''; foreach ($all as $a) { $ts = (int)strtotime((string)($a['updated_at'] ?? $a['published_at'] ?? '')); if ($ts > (int)strtotime($lastBuild ?: '1970-01-01')) { $lastBuild = date(DATE_RSS, $ts); } } if ($lastBuild === '') { $lastBuild = date(DATE_RSS); } header('Content-Type: application/rss+xml; charset=UTF-8'); header('X-Content-Type-Options: nosniff'); echo '' . "\n"; ?> <?= htmlspecialchars(siteTitle()) ?> fr 0): ?>