Skip to content

Commit

Permalink
prerender both pages
Browse files Browse the repository at this point in the history
  • Loading branch information
rossrobino committed Sep 19, 2024
1 parent 4bacfb2 commit d65afe9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions apps/docs/src/server/+app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ import type { Prerender } from "domco";
import { Injector } from "domco/injector";
import { Hono } from "hono";

export const prerender: Prerender = ["/"];
export const prerender: Prerender = ["/", "/color-generator"];

const { html: baseHtml } = processMarkdown({ md: base });
const { html: proseHtml } = processMarkdown({ md: prose });
const { html: overviewHtml } = processMarkdown({ md: overview });
const { html: themeHtml } = processMarkdown({ md: theme });
const { html: colorMdHtml } = processMarkdown({ md: color });

const app = new Hono();

app.get("/", async (c) => {
const { html: baseHtml } = processMarkdown({ md: base });
const { html: proseHtml } = processMarkdown({ md: prose });
const { html: overviewHtml } = processMarkdown({ md: overview });
const { html: themeHtml } = processMarkdown({ md: theme });

const page = new Injector(html).comment([
{ text: "prose", children: proseHtml },
{ text: "base", children: baseHtml },
Expand All @@ -31,8 +32,6 @@ app.get("/", async (c) => {
});

app.get("/color-generator", async (c) => {
const { html: colorMdHtml } = processMarkdown({ md: color });

const page = new Injector(colorHtml).comment([
{ text: "content", children: colorMdHtml },
]);
Expand Down

0 comments on commit d65afe9

Please sign in to comment.