bento-grid login page, mobile friendly docs page

This commit is contained in:
colinislit
2025-11-20 20:14:29 +01:00
parent 540bffa9ab
commit 5f7ef0801d
8 changed files with 220 additions and 83 deletions

View File

@@ -116,7 +116,24 @@ interface IndexData {
}
export async function getCategoryMetadata(): Promise<IndexData> {
const indexPath = path.join(RELEASES_DIR, '_index.json')
const indexContent = fs.readFileSync(indexPath, 'utf-8')
return JSON.parse(indexContent)
try {
const indexPath = path.join(RELEASES_DIR, '_index.json')
if (!fs.existsSync(indexPath)) {
console.warn('_index.json not found, returning empty metadata')
return {
groups: [],
categories: []
}
}
const indexContent = fs.readFileSync(indexPath, 'utf-8')
return JSON.parse(indexContent)
} catch (error) {
console.error('Error loading category metadata:', error)
return {
groups: [],
categories: []
}
}
}