Skip to content

Commit f54934a

Browse files
fullstackjamclaude
andcommitted
feat: render config detail inline for alias URLs without redirect
When a browser visits an alias URL like /fullstackjam, render the config detail page directly instead of redirecting to /username/slug. This keeps the short URL in the browser address bar. - Extract ConfigDetail into shared component - Pass alias resolution via event.locals from hooks - [username] route conditionally renders config detail or profile Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 370344e commit f54934a

6 files changed

Lines changed: 1512 additions & 1428 deletions

File tree

src/app.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
declare global {
22
namespace App {
3+
interface Locals {
4+
aliasConfig?: {
5+
username: string;
6+
slug: string;
7+
};
8+
}
39
interface Platform {
410
env: {
511
DB: D1Database;

src/hooks.server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ export const handle: Handle = async ({ event, resolve }) => {
7777
}
7878
}));
7979
} else if (isBrowser) {
80-
const baseUrl = env.APP_URL || event.url.origin;
81-
return withSecurityHeaders(Response.redirect(`${baseUrl}/${config.username}/${config.slug}`, 302));
80+
event.locals.aliasConfig = { username: config.username, slug: config.slug };
8281
}
8382
}
8483
}

0 commit comments

Comments
 (0)