fix(content): regenerate thumbnails matching the original style and fix file naming
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 9s
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🩺 Smoke Test (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🏗️ Build (push) Has been cancelled
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 9s
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🩺 Smoke Test (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🏗️ Build (push) Has been cancelled
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Website as a Service: Warum das Sorglos-Paket der einzig logische Weg für Unternehmer ist"
|
title: "Website as a Service: Warum das Sorglos-Paket der einzig logische Weg für Unternehmer ist"
|
||||||
thumbnail: "/blog/website-as-a-service-thumb.png"
|
thumbnail: "/blog/website-as-a-service.png"
|
||||||
description: "Vergessen Sie Plugin-Updates, Sicherheitslücken und Stundenabrechnungen. Ein Plädoyer für Websites ohne Overhead und warum Fixpreise den Markt revolutionieren."
|
description: "Vergessen Sie Plugin-Updates, Sicherheitslücken und Stundenabrechnungen. Ein Plädoyer für Websites ohne Overhead und warum Fixpreise den Markt revolutionieren."
|
||||||
date: "2026-05-06"
|
date: "2026-05-06"
|
||||||
tags: ["business", "management", "strategy"]
|
tags: ["business", "management", "strategy"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Zero Overhead: Warum klassische Agenturen oft zu langsam (und zu teuer) sind"
|
title: "Zero Overhead: Warum klassische Agenturen oft zu langsam (und zu teuer) sind"
|
||||||
thumbnail: "/blog/zero-overhead-agencies-thumb.png"
|
thumbnail: "/blog/zero-overhead-agencies.png"
|
||||||
description: "Projektmanager, Account Manager, Junior Designer – bei klassischen Agenturen zahlen Sie oft den Wasserkopf mit. Wie ein Lean-Ansatz bessere und schnellere Ergebnisse liefert."
|
description: "Projektmanager, Account Manager, Junior Designer – bei klassischen Agenturen zahlen Sie oft den Wasserkopf mit. Wie ein Lean-Ansatz bessere und schnellere Ergebnisse liefert."
|
||||||
date: "2026-05-06"
|
date: "2026-05-06"
|
||||||
tags: ["management", "strategy", "efficiency"]
|
tags: ["management", "strategy", "efficiency"]
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 833 KiB |
BIN
apps/web/public/blog/website-as-a-service.png
Normal file
BIN
apps/web/public/blog/website-as-a-service.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1006 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 MiB |
BIN
apps/web/public/blog/zero-overhead-agencies.png
Normal file
BIN
apps/web/public/blog/zero-overhead-agencies.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 949 KiB |
@@ -1,9 +1,10 @@
|
|||||||
import { ThumbnailGenerator } from '@mintel/thumbnail-generator';
|
import { ThumbnailGenerator } from "@mintel/thumbnail-generator";
|
||||||
import * as path from 'node:path';
|
import * as path from "node:path";
|
||||||
import * as fs from 'node:fs/promises';
|
import * as fs from "node:fs/promises";
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
const apiKey = process.env.REPLICATE_API_TOKEN || process.env.REPLICATE_API_KEY;
|
const apiKey =
|
||||||
|
process.env.REPLICATE_API_TOKEN || process.env.REPLICATE_API_KEY;
|
||||||
if (!apiKey) {
|
if (!apiKey) {
|
||||||
console.error("❌ Missing REPLICATE_API_TOKEN in environment.");
|
console.error("❌ Missing REPLICATE_API_TOKEN in environment.");
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
@@ -11,7 +12,9 @@ async function run() {
|
|||||||
|
|
||||||
const targetFile = process.argv[2];
|
const targetFile = process.argv[2];
|
||||||
if (!targetFile) {
|
if (!targetFile) {
|
||||||
console.error("❌ Usage: npx tsx scripts/generate-thumbnail.ts <file-or-topic>");
|
console.error(
|
||||||
|
"❌ Usage: npx tsx scripts/generate-thumbnail.ts <file-or-topic>",
|
||||||
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,14 +22,16 @@ async function run() {
|
|||||||
let filename = "thumbnail.png";
|
let filename = "thumbnail.png";
|
||||||
|
|
||||||
// Try to parse the topic from the MDX frontmatter if a file is provided
|
// Try to parse the topic from the MDX frontmatter if a file is provided
|
||||||
if (targetFile.endsWith('.mdx')) {
|
if (targetFile.endsWith(".mdx")) {
|
||||||
try {
|
try {
|
||||||
const content = await fs.readFile(targetFile, 'utf8');
|
const content = await fs.readFile(targetFile, "utf8");
|
||||||
const titleMatch = content.match(/title:\s*"?([^"\n]+)"?/);
|
const titleMatch = content.match(/title:\s*"?([^"\n]+)"?/);
|
||||||
topic = titleMatch ? titleMatch[1] : path.basename(targetFile, '.mdx');
|
topic = titleMatch ? titleMatch[1] : path.basename(targetFile, ".mdx");
|
||||||
filename = `${path.basename(targetFile, '.mdx')}-thumb.png`;
|
filename = `${path.basename(targetFile, ".mdx")}.png`;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(`⚠️ Could not read ${targetFile} as a file. Using literal argument as topic.`);
|
console.warn(
|
||||||
|
`⚠️ Could not read ${targetFile} as a file. Using literal argument as topic.`,
|
||||||
|
);
|
||||||
topic = targetFile;
|
topic = targetFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,10 +39,12 @@ async function run() {
|
|||||||
console.log(`Generating abstract thumbnail for topic: "${topic}"`);
|
console.log(`Generating abstract thumbnail for topic: "${topic}"`);
|
||||||
|
|
||||||
const generator = new ThumbnailGenerator({ replicateApiKey: apiKey });
|
const generator = new ThumbnailGenerator({ replicateApiKey: apiKey });
|
||||||
const isRoot = process.cwd().endsWith('mintel.me');
|
const isRoot = process.cwd().endsWith("mintel.me");
|
||||||
const baseDir = isRoot ? path.join(process.cwd(), 'apps', 'web') : process.cwd();
|
const baseDir = isRoot
|
||||||
|
? path.join(process.cwd(), "apps", "web")
|
||||||
|
: process.cwd();
|
||||||
|
|
||||||
const outputPath = path.join(baseDir, 'public', 'blog', filename);
|
const outputPath = path.join(baseDir, "public", "blog", filename);
|
||||||
|
|
||||||
// Check if thumbnail already exists to avoid redundant generation
|
// Check if thumbnail already exists to avoid redundant generation
|
||||||
try {
|
try {
|
||||||
@@ -48,7 +55,12 @@ async function run() {
|
|||||||
// File does not exist, proceed with generation
|
// File does not exist, proceed with generation
|
||||||
}
|
}
|
||||||
|
|
||||||
const inspirationPath = path.join(baseDir, 'public', 'blog', 'inspiration.png');
|
const inspirationPath = path.join(
|
||||||
|
baseDir,
|
||||||
|
"public",
|
||||||
|
"blog",
|
||||||
|
"inspiration.png",
|
||||||
|
);
|
||||||
let hasInspiration = false;
|
let hasInspiration = false;
|
||||||
try {
|
try {
|
||||||
await fs.access(inspirationPath);
|
await fs.access(inspirationPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user