Add date-based post scheduling and daily deploy cron

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>
This commit is contained in:
2026-07-01 16:35:06 +02:00
parent d1acda5a93
commit cecbda26b0
7 changed files with 84 additions and 15 deletions

View File

@@ -1,11 +1,9 @@
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import { SITE } from '../consts';
import { getPublishedPosts } from '../utils/posts';
export async function GET(context) {
const posts = (await getCollection('blog', ({ data }) => !data.draft)).sort(
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
);
const posts = await getPublishedPosts();
return rss({
title: SITE.title,