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:
parent
9691dcabc6
commit
467f2833f1
2 changed files with 4 additions and 2 deletions
|
|
@ -234,8 +234,9 @@ class DocumentCards {
|
|||
advanced: '●'
|
||||
};
|
||||
|
||||
const levelIcon = levelIcons[section.technicalLevel] || '○';
|
||||
const levelLabel = section.technicalLevel.charAt(0).toUpperCase() + section.technicalLevel.slice(1);
|
||||
const technicalLevel = section.technicalLevel || 'basic';
|
||||
const levelIcon = levelIcons[technicalLevel] || '○';
|
||||
const levelLabel = technicalLevel.charAt(0).toUpperCase() + technicalLevel.slice(1);
|
||||
|
||||
// Add soft hyphens to long titles for better wrapping
|
||||
const titleWithHyphens = this.insertSoftHyphens(section.title);
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ async function run() {
|
|||
{
|
||||
$set: {
|
||||
slug: 'glossary', // Normalize to lowercase
|
||||
category: 'getting-started', // Move to Getting Started section
|
||||
sections: sections,
|
||||
translations: translations,
|
||||
content_html: markdownToHtml(en.content),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue