From 2dcfca47912e57f49000a6b306e7ba47b5e9d014 Mon Sep 17 00:00:00 2001 From: "crawlproof[bot]" <286981042+crawlproof[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 07:41:06 +0000 Subject: [PATCH 1/2] =?UTF-8?q?Fix=20content.blog=5Ffuture=5Fdates:=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F=20Blog=20post=20dates=20are=20in=20the=20fut?= =?UTF-8?q?ure.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/blog/posts.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/blog/posts.ts b/lib/blog/posts.ts index 8fb115ea..8d36f377 100644 --- a/lib/blog/posts.ts +++ b/lib/blog/posts.ts @@ -32,14 +32,25 @@ type BlogPostRow = { content_markdown: string | null; image_url: string | null; published_at: string; + source_created_at: string | null; source: string; }; +// Resolve the best date string (YYYY-MM-DD) for a post row. +// Prefer source_created_at (the date the article was actually written/ +// published by the autoblog source) over published_at (which reflects +// the server clock at ingest time and may be skewed into the future +// if the server's system clock is ahead of wall-clock time). +function resolveDate(row: BlogPostRow): string { + const candidate = row.source_created_at ?? row.published_at; + return candidate.slice(0, 10); +} + function rowToPost(row: BlogPostRow): Post { return { slug: row.slug, title: row.title, - date: row.published_at.slice(0, 10), + date: resolveDate(row), excerpt: row.meta_description ?? "", body: "", html: row.content_html, @@ -59,7 +70,7 @@ export async function loadDbPosts(): Promise { const { data, error } = await sb .from("blog_posts") .select( - "slug, title, meta_description, content_html, content_markdown, image_url, published_at, source", + "slug, title, meta_description, content_html, content_markdown, image_url, published_at, source_created_at, source", ) .order("published_at", { ascending: false }) .limit(200); @@ -89,7 +100,7 @@ export async function findAnyPost(slug: string): Promise { const { data } = await sb .from("blog_posts") .select( - "slug, title, meta_description, content_html, content_markdown, image_url, published_at, source", + "slug, title, meta_description, content_html, content_markdown, image_url, published_at, source_created_at, source", ) .eq("slug", slug) .maybeSingle(); From 9c8fe584ca37e7f4f6f73646612befaca14b379f Mon Sep 17 00:00:00 2001 From: "crawlproof[bot]" <286981042+crawlproof[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 07:41:07 +0000 Subject: [PATCH 2/2] =?UTF-8?q?Fix=20content.blog=5Ffuture=5Fdates:=20?= =?UTF-8?q?=E2=9A=A0=EF=B8=8F=20Blog=20post=20dates=20are=20in=20the=20fut?= =?UTF-8?q?ure.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/webhooks/crawlproof/route.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/webhooks/crawlproof/route.ts b/app/api/webhooks/crawlproof/route.ts index d4180de0..849dea64 100644 --- a/app/api/webhooks/crawlproof/route.ts +++ b/app/api/webhooks/crawlproof/route.ts @@ -87,6 +87,10 @@ export async function POST(req: NextRequest) { } const { post } = parsed; + // Use the article's own publication date as published_at so the blog + // shows the real authorship date rather than the server-clock time at + // ingest (which can be skewed if the server's system clock is ahead). + const publishedAt = post.published_at ?? new Date().toISOString(); const row = { source: "crawlproof", source_id: post.id, @@ -98,7 +102,7 @@ export async function POST(req: NextRequest) { image_url: post.featured_image?.url ?? null, tags: post.tags, source_created_at: post.published_at, - published_at: new Date().toISOString(), + published_at: publishedAt, updated_at: new Date().toISOString(), };