feat: ultimate dynamic editorial overhaul

Automated CMS content seeding, integrated interactive AI Chat into Bento grid, implemented intelligent idle quote logic, and unified editorial styling across all sub-pages.
This commit is contained in:
2026-02-16 01:18:34 +01:00
parent f5081f8765
commit c3f55c92ed
6 changed files with 239 additions and 407 deletions

View File

@@ -0,0 +1,37 @@
#!/usr/bin/env node
require('dotenv').config();
const DIRECTUS_URL = process.env.DIRECTUS_URL || 'https://cms.dk0.dev';
const DIRECTUS_TOKEN = process.env.DIRECTUS_STATIC_TOKEN;
async function api(endpoint, method = 'POST', body = null) {
const res = await fetch(`${DIRECTUS_URL}/${endpoint}`, {
method,
headers: { 'Authorization': `Bearer ${DIRECTUS_TOKEN}`, 'Content-Type': 'application/json' },
body: body ? JSON.stringify(body) : null
});
return res.ok ? await res.json() : { error: true, status: res.status };
}
const seedData = [
{ key: 'hero.badge', de: 'Student & Self-Hoster', en: 'Student & Self-Hoster' },
{ key: 'hero.line1', de: 'Building', en: 'Building' },
{ key: 'hero.line2', de: 'Stuff.', en: 'Stuff.' },
{ key: 'about.quote.idle', de: 'Gerade am Planen des nächsten großen Projekts.', en: 'Currently planning the next big thing.' }
];
async function seedMessages() {
console.log('🌱 Befülle Directus mit Inhalten...');
for (const item of seedData) {
console.log(`- Erstelle Key: ${item.key}`);
const res = await api('items/messages', 'POST', {
key: item.key,
translations: [
{ languages_code: 'de-DE', value: item.de },
{ languages_code: 'en-US', value: item.en }
]
});
}
console.log('✅ CMS erfolgreich befüllt!');
}
seedMessages().catch(console.error);