Vercel/app/rss.xml/route.ts
Sam Becker 70f6f48044
Exclude photo from feeds (#280)
* Add tooltip to 'hidden' checkbox

* Refine checkbox UI

* Allow photos to be excluded from main feeds

* Fix footer grid in photos excluded from feed

* Apply feed exclusion from batch upload

* Scrub final hidden/private language

* Add visibility icons to admin photo menu
2025-07-05 23:40:58 -05:00

21 lines
601 B
TypeScript

import { getPhotosCached } from '@/photo/cache';
import { SITE_FEEDS_ENABLED } from '@/app/config';
import { formatFeedRssXml } from '@/feed/rss';
import { PROGRAMMATIC_QUERY_OPTIONS } from '@/feed';
// Cache for 24 hours
export const revalidate = 86_400;
export async function GET() {
if (SITE_FEEDS_ENABLED) {
const photos = await getPhotosCached(PROGRAMMATIC_QUERY_OPTIONS)
.catch(() => []);
return new Response(
formatFeedRssXml(photos),
{ headers: { 'Content-Type': 'text/xml' } },
);
} else {
return new Response('Feeds disabled', { status: 404 });
}
}