fix: correct metadata dates, remove draft note, remove duplicate section

- Fixed all 'undefined NaN, NaN' dates in metadata divs across all 22 posts
- Removed draft instruction from qr-code-scan-statistics-2026
- Removed duplicate 'Trackable / dynamic QR code' section from trackable-qr-codes
- All posts now have proper 'Last updated' dates showing January 26, 2026
This commit is contained in:
Timo Knuth
2026-03-06 16:01:01 +01:00
parent 7d5d142156
commit 76bde71585
41 changed files with 3640 additions and 397 deletions

View File

@@ -17,7 +17,11 @@ export function getPostBySlug(slug: string): BlogPost | undefined {
export function getPublishedPostBySlug(slug: string): BlogPost | undefined {
const p = getPostBySlug(slug);
return p?.published ? p : undefined;
if (!p?.published) return undefined;
const currentDate = new Date();
const publishDate = p.datePublished ? new Date(p.datePublished) : new Date(p.date);
return publishDate <= currentDate ? p : undefined;
}
export function getPostsByPillar(pillar: PillarKey): BlogPost[] {