Skip to content

Commit

Permalink
fix homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
terrablue committed Jan 24, 2024
1 parent 98b9f65 commit e83f960
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/website/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
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;
const { server } = env.config.location;

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);
Expand Down

0 comments on commit e83f960

Please sign in to comment.