This commit is contained in:
21
src/routes/(content)/+layout.server.ts
Normal file
21
src/routes/(content)/+layout.server.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { loadAllContent } from '$lib/content/loader';
|
||||
import { fetchContributedRepos, fetchGitHubProjects } from '$lib/github';
|
||||
import type { LayoutServerLoad } from './$types';
|
||||
|
||||
export const load: LayoutServerLoad = async () => {
|
||||
const content = await loadAllContent();
|
||||
|
||||
const [ownProjects, contributions] = await Promise.all([
|
||||
fetchGitHubProjects(content.profile.github),
|
||||
fetchContributedRepos(content.profile.github),
|
||||
]);
|
||||
|
||||
return {
|
||||
profile: content.profile,
|
||||
experience: content.experience,
|
||||
education: content.education,
|
||||
skills: content.skills,
|
||||
ownProjects,
|
||||
contributions,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user