fix: handle undefined technicalLevel in cards and set glossary category

- Added null check for section.technicalLevel (defaults to 'basic')
- Prevents "Cannot read properties of undefined (reading 'charAt')" error
- Updated fix-glossary-structure.js to set category: 'getting-started'
- Moves glossary back to Getting Started section where it belongs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
TheFlow 2025-11-01 11:41:18 +13:00
parent 2b18206328
commit 40488a3d7c
2 changed files with 4 additions and 2 deletions

View file

@ -234,8 +234,9 @@ class DocumentCards {
advanced: '●' advanced: '●'
}; };
const levelIcon = levelIcons[section.technicalLevel] || '○'; const technicalLevel = section.technicalLevel || 'basic';
const levelLabel = section.technicalLevel.charAt(0).toUpperCase() + section.technicalLevel.slice(1); const levelIcon = levelIcons[technicalLevel] || '○';
const levelLabel = technicalLevel.charAt(0).toUpperCase() + technicalLevel.slice(1);
// Add soft hyphens to long titles for better wrapping // Add soft hyphens to long titles for better wrapping
const titleWithHyphens = this.insertSoftHyphens(section.title); const titleWithHyphens = this.insertSoftHyphens(section.title);

View file

@ -160,6 +160,7 @@ async function run() {
{ {
$set: { $set: {
slug: 'glossary', // Normalize to lowercase slug: 'glossary', // Normalize to lowercase
category: 'getting-started', // Move to Getting Started section
sections: sections, sections: sections,
translations: translations, translations: translations,
content_html: markdownToHtml(en.content), content_html: markdownToHtml(en.content),