mirror of
https://github.com/supabase/supabase.git
synced 2026-05-06 22:18:00 +08:00
* 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
46 lines
1.1 KiB
TypeScript
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
|
|
}
|