getPrivateCategories(); $published = array_filter($articles->getAll(true), static function (array $a) use ($privateCats): bool { $cat = trim($a['category'] ?? ''); if ($cat !== '' && in_array($cat, $privateCats, true)) { return false; } if (strtotime((string)($a['published_at'] ?? '')) > time()) { return false; } return true; }); header('Content-Type: application/xml; charset=UTF-8'); header('X-Robots-Tag: noindex'); echo '' . "\n"; echo '' . "\n"; // Homepage echo ' ' . "\n"; echo ' ' . htmlspecialchars(rtrim(APP_URL, '/') . '/') . '' . "\n"; echo ' daily' . "\n"; echo ' 1.0' . "\n"; echo ' ' . "\n"; foreach ($published as $article) { $loc = htmlspecialchars(rtrim(APP_URL, '/') . '/post/' . rawurlencode($article['slug'] ?? '')); $lastmod = date('Y-m-d', strtotime((string)($article['updated_at'] ?? $article['published_at'] ?? 'now'))); echo ' ' . "\n"; echo ' ' . $loc . '' . "\n"; echo ' ' . $lastmod . '' . "\n"; echo ' monthly' . "\n"; echo ' 0.8' . "\n"; echo ' ' . "\n"; } echo '' . "\n";