#!/usr/bin/env node
// Replace sidebar HTML with
// and add after api.js on each page.
const fs = require('fs');
const path = require('path');
const FRONTEND = path.join(__dirname, '..', 'frontend');
// Pages that get the universal sidebar (excludes test-run.html, login.html, 403/404/500, parent.html, guest-board.html)
const PAGES = [
'admin', 'analytics',
'biochem', 'biochem-library', 'biochem-pathways', 'biochem-properties', 'biochem-reactions',
'board', 'classes', 'classroom', 'collection', 'collection-rb', 'course', 'crossword',
'dashboard', 'flashcards', 'gradebook', 'hangman', 'homework',
'knowledge-map', 'lab', 'lesson', 'lesson-editor', 'lesson-history', 'library', 'live-quiz',
'my-lessons', 'pet', 'profile', 'question-bank',
'red-book', 'red-book-biomes', 'red-book-ecosystem', 'red-book-games',
'theory',
];
// Regex: match
// Handles optional extra attributes and multi-line content
const ASIDE_RE = /