From 1d8a54b72f2942e758f850eb37903b925a8fe9d2 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Sun, 28 Jan 2024 15:19:30 +0100 Subject: [PATCH] Fix indexPage server rendering --- server/http_server.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/http_server.ts b/server/http_server.ts index 38dc2536..b2e5be7e 100644 --- a/server/http_server.ts +++ b/server/http_server.ts @@ -16,6 +16,7 @@ import { base64Encode } from "../plugos/asset_bundle/base64.ts"; import { extendedMarkdownLanguage } from "../common/markdown_parser/parser.ts"; import { parse } from "../common/markdown_parser/parse_tree.ts"; import { renderMarkdownToHtml } from "../plugs/markdown/markdown_render.ts"; +import { parsePageRef } from "$sb/lib/page.ts"; const authenticationExpirySeconds = 60 * 60 * 24 * 7; // 1 week @@ -200,11 +201,9 @@ export class HttpServer { ) { // Serve the UI (index.html) // Note: we're explicitly not setting Last-Modified and If-Modified-Since header here because this page is dynamic + const indexPage = parsePageRef(spaceServer.settings?.indexPage!).page; return c.html( - await this.renderHtmlPage( - spaceServer, - spaceServer.settings?.indexPage!, - ), + await this.renderHtmlPage(spaceServer, indexPage), 200, { "Cache-Control": "no-cache",