KI und Ich

Ein Blog über KI, Auswirkungen und Experimente von Karlheinz Agsteiner

Mein eigener Blog-Generator

Ich bin ja ein großer Freund eines eigenen Blogs. Jetzt nicht eigen im Sinne von "eine große Blogging-Maschinerie gibt mir irgendwelche Lizenzrechte an meinen Einträgen", auch nicht im Sinne von "kann da Blogs hinschreiben und habe nicht 20 Seiten Anwaltsenglisch gelesen, was der Anbieter damit machen kann". Auch nicht "ich werde reich durch bloggen, auch wenn meine User alle ihre Daten offenbaren, ohne es zu wissen". Nein. Ein eigenes Blog. Auf einem fairen Webhoster.

Der Anbieter meiner Wahl ist neocities. Ja, wie geocities damals. Gutes altes Internetgefühl.

Aber: Neocities hat nur einen ziemlich gräßlichen HTML-Editor. In diesem Blog beschreibe ich, wie man in 30 minuten zu einem Tool kommt, dass einem das Bloggen damit leicht macht. Also fast.

Achtung, das wird ein ziemlich konkreter und technischer Post. Du bist gewarnt.

Voraussetzungen

Jupp, heftige Voraussetzungen. Ich habe Cursor + Claude Sonnet 4.5 verwendet. Vermutlich gehen auch andere LLM-Agentic-Entwicklungsumgebungen wie Claude Code oder Gemini CLI.

Das ist schon mal blöd und kostet Geld.

Noch ne Erklärung

Mein Blog ist deutsch/englisch. Ich schreibe in deutsch, und will, dass die AI automatisch die englische Version macht.

Lost geht's. Der Prompt.

Gar keine einfache Sache - Beispiels-HTML lesen, Markdown-Text in HTML transferieren, der genauso funktionert, zweisprachige index.html updaten, und vor allem ChatGPT aufrufen, damit es den deutschen Text auf englisch übersetzt. Und etliche Kleinigkeiten.

Das is der originale Prompt. Sieht jetzt schlecht aus, ich wollte aber nichts ändern, incl. fehlender Zeilenumbrüche.

Create an app that creates a new entry for my personal blog based on a markdown file.

# details on the blog
My blog is hosted on neocities. All blog entries come in two languages - in my original language, German, and in English. The URL for the index file is: https://agsteiner.neocities.org/Blog/index_en.html and https://agsteiner.neocities.org/Blog/index_de.html. 
Blog entries all use the same style file: https://agsteiner.neocities.org/Blog/style.css 
All blog entries use a common structure with the same header and footer. Look at https://agsteiner.neocities.org/Blog/001_mcp_en.html and https://agsteiner.neocities.org/Blog/001_mcp_de.html for examples.
# your task
You create an app that takes a markdown file as input along with original files from my blog and creates two new HTML files, one for the English version and one for the German version of the blog entry. The app should also create an updated index_de.html and index_en.html. All your updates are local in the current directory. I will upload the files to neocities myself.
The app first reads index_en.html and index_de.html from the blog page. In the file it notes the number of the biggest prefix of any blog entry, e.g. 004_mistral_again_en.html” -> 4
Then it reads the local file - default: entry.md - and performs a remote call to ChatGPT o1 to translate it from German to English. You may assume there is a .env file with a property OPENAI_ACCESS_TOKEN that contains the token to access ChatGPT.
Then the app converts the markdown for the German and English version to HTML with file name <number>_<converted_english_title>.html where
<number> is a three-digit number of the biggest number + 1, in our example 005.
<converted_english_title> is the English title, with all letters lowercase and all special characters and whitespace converted to an underscore.
Then it adds a single line to the German and the English index.html for the new entry. It does not perform any other change to index_en.html and index_de.html.
The app can be a simple script without any UI. You can freely choose to use node.js / JS or python. Use no other language. Refrain from using bloated additional frameworks. Use only libraries that are absolutely necessary.

# environment
The app runs on this PC. Python and node.js are installed and in the path. The PC is a Windows 11 PC with normal backslash file conventions. Powershell is installed (fairly old version)

Und die AI werkelt los.

Einmal musste ich sie unterbrechen, weil sie sich in einem curl Kommando irgendwie aufgehängt hatte.

Danach war sie bereit. Ausprobiert. Tut nicht. Komischer Fehler. WIE? NICHT PERFEKT? Ich kopiere die gesamte Fehlermeldung in den Chat, das LLM erkennt, dass wohl eine veraltete OpenAI Version installiert wurde, ändert das. Danach will die Maschine es genau wissen, probiert die App aus, vergleicht, ob sie funktioniert, schaut, ob das Ergebnis in beiden Sprachen passt. Schaut, ob die index_de/en.html stimmen.

Als die AI sagt "Fertig", ist fertig.

Fast.

Was geht und was nicht.

Okay, ich geb's zu, ich habe ChatGPT damals belogen, als ich mich registriere. Dort heisse ich "Karl Stein". Und prompt generiert ChatGPT mir in den übersetzten Text Karl Stein als meinen Namen. Seltsamerweise sogar im Python-File, das ja eigentlich nicht ChatGPT sondern Claude Sonnet generiert hat. Hab ich da auch geschwindelt?

Das habe ich, obschon praktisch keine Python-Kenntnisse, manuell geändert.

Und die Reihenfolge der Einträge im index.html stimmt nicht. Da hat sie eigentlich recht, die AI, neue Einträge gehören nach oben, nicht nach unten.

Aber sonst stimmt alles.

Ergebnis

15 Minuten Spec schreiben, 15 Minuten mit der AI arbeiten, bis das Skript steht, ein paar Nacharbeiten. Passt. Jetzt habe ich ein Python-Programm, das mir die Arbeit abnimmt. Alles, was ich jetzt tun muss, ist einen Blog-Eintrag als Markdown schreiben, und bekomme zwei HTML-Files in korrekter Formatierung + neue Index-Files. Fein.

Willst du sowas auch? Idealerweise für neocities? Schreib mir.

ps. später nochmal 5 Minuten investiert. Jetzt ruft der Blog-Erzeugerich ChatGPT-5, damit es das HTML analysiert und vernünftige Hyperlinks zu gängigen Produkten uä einfügt. Tut auf Anhieb. Nett.