fediverse:creator

Matthias Ott wrote the post “Highlighting Blogging on Mastodon” six months ago, and today I’ve added the meta tag to this little page as well. <meta property="fediverse:creator" content="@[email protected]" /> The text was automatically translated from German into English. The German quotations were also translated in sense.

January 11, 2025 · 1 min · 46 words

Bookmarklet Blogging

I recently came across an interesting Bookmarklet bei Nicolas. It’s meant to make link-blogging easier for anyone with a GitHub-hosted blog. The script isn’t perfect yet, but it inspired me to develop it further. Here’s my version of the bookmarklet (function() { // Funktion zum Erstellen eines "Slug" aus einem Text const slugify = text => { let str = text.toString(); // Den Text als Zeichenkette behandeln str = str.replaceAll("/", " "); // Schrägstriche (/) durch Leerzeichen ersetzen str = str.normalize("NFD"); // Unicode normalisieren (diakritische Zeichen trennen) str = str.replace(/[^\w\s-]+/g, ""); // Sonderzeichen entfernen (außer Buchstaben, Zahlen, Leerzeichen, Bindestriche) str = str.toLowerCase(); // In Kleinbuchstaben umwandeln str = str.replace(/\s+/g, " "); // Mehrere Leerzeichen auf ein einzelnes reduzieren str = str.trim(); // Führende und endende Leerzeichen entfernen str = str.replace(/ +/g, "-"); // Alle Leerzeichen durch Bindestriche ersetzen return str; // Slug zurückgeben }; // Titel der aktuellen Seite aus dem Dokument abrufen let pageTitle = window.document.title; // Falls ein Text markiert ist, diesen als "linkSelection" setzen, ansonsten leer let linkSelection = "getSelection" in window ? window.getSelection().toString().trim() : ""; // Inhalt für den Link ermitteln: // Zuerst den markierten Text verwenden, falls vorhanden, ansonsten eine Meta-Beschreibung, // oder den ersten Absatz im <main>, <article>, oder <p>-Tag let linkContent = linkSelection || window.document.querySelector("head meta[name=description]")?.content.trim() || window.document.querySelector("main p")?.textContent.trim() || window.document.querySelector("article p")?.textContent.trim() || window.document.querySelector("p")?.textContent.trim(); // Die URL der aktuellen Seite let linkUrl = window.location.href; // Eingabeaufforderung für den Link-Titel (Standardwert: Seiten-Titel) let title = window.prompt("Title of the link?", pageTitle); if (title !== null) { // Nur fortfahren, wenn der Benutzer einen Titel angegeben hat // Eingabeaufforderung für den Link-Slug (Standardwert: aus Titel generierter Slug) let slug = window.prompt("Slug of the link?", slugify(title)); if (slug !== null) { // Nur fortfahren, wenn der Benutzer einen Slug angegeben hat // Das aktuelle Datum und die Uhrzeit im ISO-Format abrufen und in lesbare Form bringen const currentDate = (new Date()).toISOString().replace("T", " ").replace(/\.\d{3}Z/, " +00:00"); // Dateiinhalt für den Blogeintrag erstellen let fileContent = `---\n` + `date: ${currentDate}\n` + `title: "${title}"\n` + `authors: "maik"\n` + `tags: []\n` + `---\n\n` + `[${title}](${linkUrl} "${title}") für ${linkUrl}\n\n` + `${linkContent ? linkContent.replaceAll("\n", "\n> ") : ""}\n`; // GitHub-URL für das Erstellen einer neuen Datei zusammenbauen let githubUrl = `https://github.com/Maik-Wi/blog/new/main/?` + `filename=${`content/notes/${currentDate.slice(0, 10)}-${slug}-index.md`}` + `&value=${encodeURIComponent(fileContent)}` + `&message=${encodeURIComponent(`New link: ${title}`)}`; // Die URL in einem neuen Fenster öffnen, sodass der Nutzer sie bei GitHub weiterbearbeiten kann window.open(githubUrl); } } })(); The text was automatically translated from German into English. The German quotations were also translated in sense. ...

August 19, 2024 · 2 min · 414 words

Blogging over SSH

Once again this blog has been a bit neglected. So far I had been blogging with an iOS Shortcut workflow, but it somehow stopped working. I adjusted the process again — technically it worked, but it wasn’t very practical. I briefly googled how others had solved the problem and came across Post from Rosemary Orchard. This workflow uses the stdin input option of the Run Script Over SSH action — in simple terms, it lets you pass input to that action as well as use variables as input in the script section. – Rosemary Orchard von 27. August 2018 ...

January 11, 2020 · 1 min · 136 words

Images are not displayed in WordPress

I recently had the problem that when I wrote a post from the iPhone or from Windows Live Writer, the image code was broken. I had written the following HTML code: <img src=”http://example.com/wp-content/uploads/2009/05/test.jpg” border=”0″ alt=”DSA00005.JPG” width=”431″ height=”284″ /> But the blog received the following: img src=”http://example.com/wp-content/uploads/2009/05/test.jpg” border=”0″ alt=”DSA00005.JPG” width=”431″ height=”284″ / So all < and > were removed. I searched through several German WordPress forums, but in the end I found the solution in the official English WordPress forum. ...

May 8, 2009 · 1 min · 161 words