Files
Orchestrator/privat/CV/andreknie.de/scripts/execute-user-requests.js
T
ankn b46de6dc7d
Deploy CV Site (andreknie.de) / deploy (push) Canceled after 0s
ci: migrate GitHub actions to Gitea actions
2026-07-22 15:42:06 +02:00

145 lines
6.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import fs from 'fs'
import path from 'path'
import matter from 'gray-matter'
const POSTS_DIR = path.join(process.cwd(), 'content', 'posts')
const KNIEPUNKT_DIR = path.join(process.cwd(), 'content', 'kniepunkt')
const CONSULTING_DIR = path.join(process.cwd(), 'content', 'consulting')
const TALKS_DIR = path.join(process.cwd(), 'content', 'talks')
function deleteIfExists(file) {
if (fs.existsSync(file)) {
fs.unlinkSync(file)
console.log('Deleted:', path.basename(file))
}
}
// 1. Delete requested posts
const toDelete = [
'2026-04-06-puenktlich-zu-ostern-haben-sich-lasse-und-ich-ueber-ki-und-kirche-unterhalten-es.md',
'2026-01-02-ai-almost-intelligent-geht-in-die-vierte-runde.md',
'2025-12-26-zweiter-weihnachtsfeiertag.md',
'2025-08-29-glueckwunsch-zu-dem-artikel.md',
'2023-07-19-jobsharing-ist-eine-tolle-moeglichkeit-fuehrung-zu-leben-im-direkten-sparring-ka.md',
'2022-12-23-mindestens-drei-marketingprofessionals-melden-sich-hier-pro-woche-bei-mir-was-s.md',
'2022-11-22-jobsharing-fuer-maenner-geht-das.md',
'2022-09-22-sonnenaufgang-zwischen-goettingen-und-hildesheim-der-tag-hat-frueh-begonnen-aber.md',
'2022-07-23-wer-beschwert-sich-gerne-ueber-die-bahn-fast-jeder-den-ich-kenne-aber-die-meist.md',
'2021-12-17-eine-echte-chance-den-zugang-zur-welt-der-bahn-einfacher-schneller-und-attrakti.md',
'2020-04-01-die-krise-bietet-auch-chancen-digitalisierung-und-homeoffice-wird-ploetzlich-nor.md',
// Post 12
'2025-11-15-heute-geht-es-um-musik-immerhin-ist-ein-virtueller-ki-cowboy-auf-platz-1-der-co.md'
]
toDelete.forEach(f => deleteIfExists(path.join(POSTS_DIR, f)))
// 3. Post 16 -> Workshop section
const post16Path = path.join(POSTS_DIR, '2025-10-16-unsere-ki-fraitage-an-der-universitaet-kassel-haben-auch-grosses-interesse-bei-a.md')
if (fs.existsSync(post16Path)) {
const p16 = matter(fs.readFileSync(post16Path, 'utf8'))
const ws16 = `id: ki-experimentierraeume-verwaltung
title: "KI über #Experimentierräume erfolgreich in der Verwaltung etablieren"
description: "${p16.content.trim().replace(/\n/g, ' ')}"
format: workshop
target_audience: [public-admin, universities]
tags: [ki, verwaltung, experimentierraeume]
visibility: primary
`
fs.writeFileSync(path.join(CONSULTING_DIR, 'ki-experimentierraeume-verwaltung.yaml'), ws16)
deleteIfExists(post16Path)
console.log('Moved Post 16 to consulting')
}
// 4. Post 17 -> Merge into Zwischen Gigafactories und DSGVO
const post17Path = path.join(POSTS_DIR, '2025-10-09-diese-woche-kamen-gleich-zwei-grosse-europaeische-ki-initiativen-auf-die-buehne-.md')
const gigaPath = path.join(POSTS_DIR, '2025-10-10-zwischen-gigafactories-und-dsgvo-europas-ki-dilemma.md')
if (fs.existsSync(post17Path) && fs.existsSync(gigaPath)) {
const p17 = matter(fs.readFileSync(post17Path, 'utf8'))
let giga = matter(fs.readFileSync(gigaPath, 'utf8'))
if (!giga.content.includes(p17.content.trim())) {
giga.content = `> ${p17.content.trim()}\n\n---\n\n${giga.content}`
fs.writeFileSync(gigaPath, matter.stringify(giga.content, giga.data))
console.log('Merged Post 17 into article')
}
deleteIfExists(post17Path)
}
// 5. Post 18 is Kniepunkt 006
const post18Path = path.join(POSTS_DIR, '2025-10-03-ki-wunderkind-oder-klassenclown.md')
const kp006Path = path.join(KNIEPUNKT_DIR, '006-ki-wunderkind-oder-klassenclown.md')
if (fs.existsSync(post18Path)) {
fs.renameSync(post18Path, kp006Path)
console.log('Moved Post 18 to Kniepunkt 006')
}
// 6 & 7. Posts 21 and 23 are already in Kniepunkt, delete from posts
deleteIfExists(path.join(POSTS_DIR, '2025-09-20-die-ki-wetterkarte-zeigt-ein-chaotisches-bild-ueber-london-und-washington-regnet.md'))
deleteIfExists(path.join(POSTS_DIR, '2025-09-06-ki-als-fitnessstudio-abo-jeder-bezahlt-es-aber-kaum-einer-nutzt-es.md'))
// 8. Rename Post 30 title
const post30Path = path.join(POSTS_DIR, '2025-07-25-untitled-post.md')
if (fs.existsSync(post30Path)) {
let p30 = matter(fs.readFileSync(post30Path, 'utf8'))
p30.data.title = 'Braucht es wirklich einen Chief AI Officer?'
fs.writeFileSync(post30Path, matter.stringify(p30.content, p30.data))
console.log('Renamed Post 30')
}
// 9. Post 36 -> Workshop
const post36Path = path.join(POSTS_DIR, '2024-04-03-wir-freuen-uns-auch-darauf-zeigen-zu-koennen-dass-jeder-produzierende-betrieb-am.md')
if (fs.existsSync(post36Path)) {
const p36 = matter(fs.readFileSync(post36Path, 'utf8'))
const ws36 = `id: ki-in-der-praxis
title: "KI in der Praxis von der Datenerfassung bis zum Produktiveinsatz"
description: "${p36.content.trim().replace(/\n/g, ' ')}"
format: workshop
target_audience: [mittelstand, executives]
tags: [ki, datenerfassung, produktiveinsatz, praxis]
visibility: primary
`
fs.writeFileSync(path.join(CONSULTING_DIR, 'ki-in-der-praxis.yaml'), ws36)
deleteIfExists(post36Path)
console.log('Moved Post 36 to consulting')
}
// 10. Post 38 -> Retitle
const post38Path = path.join(POSTS_DIR, '2023-12-19-.md')
if (fs.existsSync(post38Path)) {
let p38 = matter(fs.readFileSync(post38Path, 'utf8'))
p38.data.title = 'Lehrer sind Führungskräfte!'
fs.writeFileSync(post38Path, matter.stringify(p38.content, p38.data))
console.log('Renamed Post 38')
}
// 11. Post 50 -> Experience as mentor
const post50Path = path.join(POSTS_DIR, '2021-12-16-es-hat-mir-viel-freude-bereitet-mit-start-ups-zu-diskutieren-welche-rolle-newwo.md')
if (fs.existsSync(post50Path)) {
const t50 = `id: mentor-pwc-scale-2021
title: "PwC #Scale Mentor"
description: "Startschuss des diesjährigen PwC #Scale. Mentoring zu Investor Readiness, Corporate Sales und Geschäftsmodellentwicklung."
format: mentoring
target_audience: [startups]
tags: [newwork, culture, makechangework, pwc, lemin]
visibility: primary
`
fs.writeFileSync(path.join(TALKS_DIR, 'mentor-pwc-scale-2021.yaml'), t50)
deleteIfExists(post50Path)
console.log('Moved Post 50 to talks as mentor')
}
// 12. Post 53 -> Experience as speaker
const post53Path = path.join(POSTS_DIR, '2020-07-29-ich-freue-mich-auf-digitaler-live-talk-agiles-arbeiten.md')
if (fs.existsSync(post53Path)) {
const t53 = `id: einfachbahn-agiles-arbeiten-2020
title: "Agiles Arbeiten bei der DB Netz AG: Haltung, Methoden und Selbstorganisation bei der #Einfachbahn"
description: "Digitaler Live-Talk: Agiles Arbeiten. Praxisbeispiele für neue Arbeitsweisen, servant leadership und Selbstorganisation."
format: keynote
target_audience: [executives, public-admin, mittelstand]
tags: [newwork, einfachbahn, leadership, agile]
visibility: primary
`
fs.writeFileSync(path.join(TALKS_DIR, 'einfachbahn-agiles-arbeiten-2020.yaml'), t53)
deleteIfExists(post53Path)
console.log('Moved Post 53 to talks as speaker')
}