diff --git a/packages/website/routes/index.js b/packages/website/routes/index.js index aec6258f..a40f9c3d 100644 --- a/packages/website/routes/index.js +++ b/packages/website/routes/index.js @@ -1,8 +1,6 @@ import { from } from "rcompat/object"; import { view } from "primate"; -const example_files = ["backend", "frontend", "runtime", "i18n"]; - export default { async get(request) { const { env, config } = request; @@ -10,12 +8,11 @@ export default { const base = await env.runpath(server, config.root, "examples"); - const props = { - app: request.config, - examples: from((await Promise.all(example_files)).map(async section => + const examples = from(await Promise.all(["backend", "frontend", "runtime", "i18n"] + .map(async section => [section, await (base.join(`${section}.md.html`)).text()] - )), - }; + ))); + const props = { app: request.config, examples }; const options = { placeholders: request.placeholders }; return view("Homepage.svelte", props, options);