Gate blog listings/RSS on pubDate<=now (in addition to !draft) via a shared getPublishedPosts() helper, so a post set to draft:false with a future pubDate publishes itself once a build runs on that day. Dev shows everything for preview. Add .gitea/workflows/scheduled-deploy.yml: a daily cron that pings the Coolify deploy hook so the static site rebuilds and the date gate advances. No file mutation, no repo write access — needs a runner + COOLIFY_DEPLOY_HOOK secret. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
20 lines
487 B
JavaScript
20 lines
487 B
JavaScript
import rss from '@astrojs/rss';
|
|
import { SITE } from '../consts';
|
|
import { getPublishedPosts } from '../utils/posts';
|
|
|
|
export async function GET(context) {
|
|
const posts = await getPublishedPosts();
|
|
|
|
return rss({
|
|
title: SITE.title,
|
|
description: SITE.description,
|
|
site: context.site,
|
|
items: posts.map((post) => ({
|
|
title: post.data.title,
|
|
description: post.data.description,
|
|
pubDate: post.data.pubDate,
|
|
link: `/blog/${post.id}/`,
|
|
})),
|
|
});
|
|
}
|