You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

20 lines
640 B

/**
* Server-side loader for GitRepublic documentation
*/
import { readFile } from 'fs/promises';
import { join } from 'path';
import type { PageServerLoad } from './$types';
import logger from '$lib/services/logger.js';
export const load: PageServerLoad = async () => {
try {
// Read tutorial documentation from docs/tutorial.md
const filePath = join(process.cwd(), 'docs', 'tutorial.md');
const content = await readFile(filePath, 'utf-8');
return { content };
} catch (error) {
logger.error({ error }, 'Error loading documentation');
return { content: null, error: 'Failed to load documentation' };
}
};