From 68fe291b55b383d750280ad9958c3b6180c1b45d Mon Sep 17 00:00:00 2001 From: sebastjan Date: Sat, 15 Aug 2026 08:30:37 +0200 Subject: [PATCH] Clanek s targetUrl se ob kliku preusmeri (302) --- server/static.ts | 4 ++++ shared/schema.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/server/static.ts b/server/static.ts index e08e0c9..015c4e7 100644 --- a/server/static.ts +++ b/server/static.ts @@ -64,6 +64,10 @@ export function serveStatic(app: Express) { try { const slug = decodeURIComponent(articleMatch[1]); const article = await storage.getArticleBySlug(slug); + if (article && (article as any).targetUrl) { + res.redirect(302, (article as any).targetUrl); + return; + } if (article) { const articleUrl = `${canonicalBase}/article/${article.slug}`; const imageUrl = ogImageUrl(article.coverImage || "", canonicalBase); diff --git a/shared/schema.ts b/shared/schema.ts index e0ccc77..acdc822 100644 --- a/shared/schema.ts +++ b/shared/schema.ts @@ -14,6 +14,7 @@ export const articles = pgTable("articles", { author: varchar("author", { length: 255 }).notNull().default("Folx Music Television"), featured: boolean("featured").notNull().default(false), views: integer("views").notNull().default(0), + targetUrl: text("target_url"), publishedAt: timestamp("published_at").notNull().defaultNow(), });