refactor: replace ?view= query params with path-based routes in rSocials
/rsocials → canvas view (default) /rsocials/scheduler → Postiz iframe /rsocials/feed → demo feed / landing /rsocials/landing → landing page Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
bc9f5bcfb4
commit
99749d8cf2
|
|
@ -512,13 +512,10 @@ function renderDemoFeedHTML(): string {
|
|||
</div>`;
|
||||
}
|
||||
|
||||
// ── Main page route ──
|
||||
// ── Path-based sub-routes ──
|
||||
|
||||
routes.get("/", (c) => {
|
||||
routes.get("/scheduler", (c) => {
|
||||
const space = c.req.param("space") || "demo";
|
||||
const view = c.req.query("view");
|
||||
|
||||
if (view === "app") {
|
||||
return c.html(renderExternalAppShell({
|
||||
title: `${space} — Postiz | rSpace`,
|
||||
moduleId: "rsocials",
|
||||
|
|
@ -528,9 +525,10 @@ routes.get("/", (c) => {
|
|||
appName: "Postiz",
|
||||
theme: "dark",
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
if (view === "feed") {
|
||||
routes.get("/feed", (c) => {
|
||||
const space = c.req.param("space") || "demo";
|
||||
const isDemo = space === "demo";
|
||||
const body = isDemo ? renderDemoFeedHTML() : renderLanding();
|
||||
const styles = isDemo
|
||||
|
|
@ -545,9 +543,10 @@ routes.get("/", (c) => {
|
|||
body,
|
||||
styles,
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
if (view === "landing") {
|
||||
routes.get("/landing", (c) => {
|
||||
const space = c.req.param("space") || "demo";
|
||||
return c.html(renderShell({
|
||||
title: `${space} — rSocials | rSpace`,
|
||||
moduleId: "rsocials",
|
||||
|
|
@ -557,9 +556,12 @@ routes.get("/", (c) => {
|
|||
body: renderLanding(),
|
||||
styles: `<style>${RICH_LANDING_CSS}</style>`,
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
// Default: canvas view
|
||||
// ── Default: canvas view ──
|
||||
|
||||
routes.get("/", (c) => {
|
||||
const space = c.req.param("space") || "demo";
|
||||
return c.html(renderShell({
|
||||
title: `${space} — rSocials | rSpace`,
|
||||
moduleId: "rsocials",
|
||||
|
|
|
|||
Loading…
Reference in New Issue