tractatus/scripts/fix-remaining-index-gradients.js
TheFlow ac2db33732 fix(submissions): restructure Economist package and fix article display
- Create Economist SubmissionTracking package correctly:
  * mainArticle = full blog post content
  * coverLetter = 216-word SIR— letter
  * Links to blog post via blogPostId
- Archive 'Letter to The Economist' from blog posts (it's the cover letter)
- Fix date display on article cards (use published_at)
- Target publication already displaying via blue badge

Database changes:
- Make blogPostId optional in SubmissionTracking model
- Economist package ID: 68fa85ae49d4900e7f2ecd83
- Le Monde package ID: 68fa2abd2e6acd5691932150

Next: Enhanced modal with tabs, validation, export

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 08:47:42 +13:00

34 lines
1.1 KiB
JavaScript

#!/usr/bin/env node
/**
* Fix remaining gradient violations in index.html
*/
const fs = require('fs');
const path = require('path');
const filePath = path.join(__dirname, '../public/index.html');
let content = fs.readFileSync(filePath, 'utf8');
const replacements = [
{ from: ' style="background: var(--gradient-btn-boundary);"', to: ' class="bg-gradient-service-boundary"' },
{ from: ' style="background: var(--gradient-btn-pressure);"', to: ' class="bg-gradient-service-pressure"' },
{ from: ' style="background: var(--gradient-btn-metacognitive);"', to: ' class="bg-gradient-service-metacognitive"' }
];
let fixed = 0;
replacements.forEach(({ from, to }) => {
const count = (content.match(new RegExp(from.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g')) || []).length;
if (count > 0) {
content = content.split(from).join(to);
fixed += count;
console.log(`✓ Fixed ${count} occurrence(s) of ${from.substring(0, 40)}...`);
}
});
if (fixed > 0) {
fs.writeFileSync(filePath, content);
console.log(`\n✓ Total fixes applied to index.html: ${fixed}\n`);
} else {
console.log('\n• No violations found\n');
}