diff --git a/modules/rpast/mod.ts b/modules/rpast/mod.ts index 4dc5c99b..5f9ed72a 100644 --- a/modules/rpast/mod.ts +++ b/modules/rpast/mod.ts @@ -12,11 +12,30 @@ import { enumerateCreations, listCreationEnumerators, renderMarkwhen, } from '../../shared/markwhen'; import { renderMarkwhenHtml } from '../../shared/markwhen/html-render'; +import { renderShell } from '../../server/shell'; +import { getModuleInfoList } from '../../shared/module'; import { pastSchema } from './schemas'; import { renderLanding } from './landing'; const routes = new Hono(); +// GET / — marketing landing on bare domain, interactive viewer in a space. +routes.get('/', c => { + const space = c.req.param('space') || 'demo'; + if (!space || space === 'rpast.online') { + return c.html(renderLanding()); + } + return c.html(renderShell({ + title: `${space} — rPast | rSpace`, + moduleId: 'rpast', + spaceSlug: space, + modules: getModuleInfoList(), + theme: 'dark', + body: ``, + scripts: ``, + })); +}); + routes.get('/api/modules', c => { return c.json(listCreationEnumerators().map(e => ({ module: e.module, label: e.label, icon: e.icon, color: e.color,