Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/llms-txt-hub / apps/web/actions/get-home-page-data.ts |
| Date | Not specified in source |
| Repository | Janady13/llms-txt-hub |
| Revision | e0f4bf978d4df168369c7601d9c5f5ea89e84377 |
| Branch | main |
| Path or archive member | apps/web/actions/get-home-page-data.ts |
| Original SHA-256 | 993f0254603be196420c9233941f61f1f645c6a56d0886b96d678c28e23f1d94 |
| Git blob SHA | 5583f4aafc68d12778174ac9df0e64cceb87ad2a |
| Reading-copy SHA-256 | 993f0254603be196420c9233941f61f1f645c6a56d0886b96d678c28e23f1d94 |
Recovered source transcript
Download complete source text ↓34 lines · 1.2 KB
'use server'
import { getGuides, getWebsites } from '@/lib/content-loader'
import { getLatestMembers } from '@/lib/members'
import { getFeaturedProjects, getRecentlyUpdatedProjects } from '@/lib/project-utils'
/**
* Fetches homepage data including featured projects, recently updated projects, and initial website list
* Optimized to load only first 48 websites initially to improve performance
*
* @returns Promise containing homepage data with pagination info
*/
export async function getHomePageData() {
const allProjects = await getWebsites()
const featuredProjects = getFeaturedProjects(allProjects)
const recentlyUpdatedProjects = getRecentlyUpdatedProjects(allProjects, 8)
// Only load first 48 projects for initial homepage render to improve performance
// This reduces initial bundle size and data transfer from ~900 to 48 websites
const initialProjects = allProjects.slice(0, 48)
const featuredGuides = await getGuides()
const latestMembers = await getLatestMembers({ limit: 6 })
return {
allProjects: initialProjects,
featuredProjects,
recentlyUpdatedProjects,
totalCount: allProjects.length,
featuredGuides,
latestMembers
}
}