Compare commits
2 Commits
a2acf963f7
...
06c095eb19
| Author | SHA1 | Date |
|---|---|---|
|
|
06c095eb19 | |
|
|
14ffee4101 |
|
|
@ -12,11 +12,30 @@ import {
|
||||||
enumerateCreations, listCreationEnumerators, renderMarkwhen,
|
enumerateCreations, listCreationEnumerators, renderMarkwhen,
|
||||||
} from '../../shared/markwhen';
|
} from '../../shared/markwhen';
|
||||||
import { renderMarkwhenHtml } from '../../shared/markwhen/html-render';
|
import { renderMarkwhenHtml } from '../../shared/markwhen/html-render';
|
||||||
|
import { renderShell } from '../../server/shell';
|
||||||
|
import { getModuleInfoList } from '../../shared/module';
|
||||||
import { pastSchema } from './schemas';
|
import { pastSchema } from './schemas';
|
||||||
import { renderLanding } from './landing';
|
import { renderLanding } from './landing';
|
||||||
|
|
||||||
const routes = new Hono();
|
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: `<rpast-viewer space="${space}" style="height:calc(100vh - 52px);display:block"></rpast-viewer>`,
|
||||||
|
scripts: `<script type="module" src="/modules/rpast/rpast-viewer.js?v=1"></script>`,
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
routes.get('/api/modules', c => {
|
routes.get('/api/modules', c => {
|
||||||
return c.json(listCreationEnumerators().map(e => ({
|
return c.json(listCreationEnumerators().map(e => ({
|
||||||
module: e.module, label: e.label, icon: e.icon, color: e.color,
|
module: e.module, label: e.label, icon: e.icon, color: e.color,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue