|
|
@ -26,17 +26,14 @@ function linkGroupPathToId(filePath: string): string { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
export async function getAllLinkGroups(): Promise<LinkGroupFileType[]> { |
|
|
|
export async function getAllLinkGroups(): Promise<LinkGroupFileType[]> { |
|
|
|
const linkGroups = await import.meta.glob<LinkGroupFileType>( |
|
|
|
const linkGroups = await import.meta.glob<LinkGroupFileType>( |
|
|
|
'/src/link-groups/*.md', |
|
|
|
'/src/data/link-groups/*.md', |
|
|
|
{ |
|
|
|
{ |
|
|
|
eager: true, |
|
|
|
eager: true, |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const linkGroupFiles = Object.values(linkGroups); |
|
|
|
return Object.values(linkGroups).map((linkGroupFile) => ({ |
|
|
|
const enrichedLinkGroups = linkGroupFiles.map((linkGroupFile) => ({ |
|
|
|
|
|
|
|
...linkGroupFile, |
|
|
|
...linkGroupFile, |
|
|
|
id: linkGroupPathToId(linkGroupFile.file), |
|
|
|
id: linkGroupPathToId(linkGroupFile.file), |
|
|
|
})); |
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
return enrichedLinkGroups; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|