diff --git a/svelte-app/src/lib/consts.ts b/svelte-app/src/lib/consts.ts index 088b1197a..240881f49 100644 --- a/svelte-app/src/lib/consts.ts +++ b/svelte-app/src/lib/consts.ts @@ -62,7 +62,7 @@ export const BASE_TRANSITION_DURATION = 200 as const; export const BASE_ANIMATION_DURATION = 300 as const; export const HOMEPAGE_POSTS_NUM = 4 as const; -export const HOMEPAGE_PROJECTS_NUM = 1 as const; +export const HOMEPAGE_PROJECTS_NUM = 4 as const; export const RECENT_POSTS_COUNT = 99; export const RECENT_PROJECTS_COUNT = 99; diff --git a/svelte-app/src/routes/[[lang=lang]]/+page.ts b/svelte-app/src/routes/[[lang=lang]]/+page.ts index 30ecad06d..6db2422fa 100644 --- a/svelte-app/src/routes/[[lang=lang]]/+page.ts +++ b/svelte-app/src/routes/[[lang=lang]]/+page.ts @@ -1,6 +1,6 @@ -import { DEFAULT_APP_LANG, HOMEPAGE_POSTS_NUM } from '$lib/consts'; +import { DEFAULT_APP_LANG, HOMEPAGE_POSTS_NUM, HOMEPAGE_PROJECTS_NUM } from '$lib/consts'; import { handleLoadError } from '$lib/data'; -import { find, findOne } from '$lib/store'; +import { find } from '$lib/store'; import type { PageLoad } from './$types'; import type { AuthorDocument, PostDocument, ProjectDocument } from '$types'; @@ -10,14 +10,14 @@ export const load = (async ({ parent, fetch, params }) => { promises = [ parent().then((data) => data.about), find(fetch, 'post', { limit: HOMEPAGE_POSTS_NUM, lang }), - findOne(fetch, 'project', { id: 'kio.dev', lang }) + find(fetch, 'project', { limit: HOMEPAGE_PROJECTS_NUM, lang }) ]; - const [about, posts, project] = handleLoadError(await Promise.all(promises)) as [ + const [about, posts, projects] = handleLoadError(await Promise.all(promises)) as [ AuthorDocument, PostDocument[], - ProjectDocument + ProjectDocument[] ]; - return { posts, projects: [project], about }; + return { posts, projects, about }; }) satisfies PageLoad;