mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-30 23:30:04 +00:00
format file
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
import { guides } from '$lib/components/docs/docs.js';
|
||||
|
||||
function getModule(language: string | undefined, guide: string) {
|
||||
language = language ?? 'en';
|
||||
let subguide = undefined;
|
||||
if (guide.includes('/')) {
|
||||
[guide, subguide] = guide.split('/');
|
||||
}
|
||||
return subguide
|
||||
? import(`./../lib/docs/${language}/${guide}/${subguide}.mdx`)
|
||||
: import(`./../lib/docs/${language}/${guide}.mdx`);
|
||||
language = language ?? 'en';
|
||||
let subguide = undefined;
|
||||
if (guide.includes('/')) {
|
||||
[guide, subguide] = guide.split('/');
|
||||
}
|
||||
return subguide
|
||||
? import(`./../lib/docs/${language}/${guide}/${subguide}.mdx`)
|
||||
: import(`./../lib/docs/${language}/${guide}.mdx`);
|
||||
}
|
||||
|
||||
export async function load({ params }) {
|
||||
const { language } = params;
|
||||
const { language } = params;
|
||||
|
||||
const guideTitles: Record<string, string> = {};
|
||||
for (let guide of Object.keys(guides)) {
|
||||
guideTitles[guide] = (await getModule(language, guide)).metadata.title;
|
||||
for (let subguide of guides[guide]) {
|
||||
guideTitles[`${guide}/${subguide}`] = (
|
||||
await getModule(language, `${guide}/${subguide}`)
|
||||
).metadata.title;
|
||||
}
|
||||
}
|
||||
const guideTitles: Record<string, string> = {};
|
||||
for (let guide of Object.keys(guides)) {
|
||||
guideTitles[guide] = (await getModule(language, guide)).metadata.title;
|
||||
for (let subguide of guides[guide]) {
|
||||
guideTitles[`${guide}/${subguide}`] = (
|
||||
await getModule(language, `${guide}/${subguide}`)
|
||||
).metadata.title;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
guideTitles
|
||||
};
|
||||
return {
|
||||
guideTitles,
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user