Files
supabase/apps/www/lib/static-content.ts
Francesco Sansalvadore 2feda5ee19 cms www blog (#38045)
* show cms blog posts in www
* remove contentlayer from www
* outputFileTracingExcludes
* update remotePatterns
* fetch cms posts server-side with revalidation
* add cms env vars to turbo.json
* add www env vars to turbo.json
* include cms posts in www sitemap
* add migration to remove image from cms post
* update cms meta image mapping in www
2025-09-03 14:49:28 +02:00

46 lines
1.1 KiB
TypeScript

export interface StaticContent {
latestBlogPosts: Array<{
title: string
url: string
description: string
date: string
formattedDate: string
}>
jobsCount: number
githubStars: number
}
// Default values for client-side rendering
const defaultStaticContent: StaticContent = {
latestBlogPosts: [],
jobsCount: 0,
githubStars: 0,
}
/**
* Get latest blog posts from static content
* Only works on server-side during build time
*/
export const getLatestBlogPosts = (): StaticContent['latestBlogPosts'] => {
// Always return empty array for client-side usage
return defaultStaticContent.latestBlogPosts
}
/**
* Get jobs count from static content
* Only works on server-side during build time
*/
export const getJobsCount = (): number => {
// Always return default value for client-side usage
return defaultStaticContent.jobsCount
}
/**
* Get GitHub stars from static content
* Only works on server-side during build time
*/
export const getGitHubStars = (): number => {
// Always return default value for client-side usage
return defaultStaticContent.githubStars
}