chore: add index layout to island tests (#1340)

This commit is contained in:
Marvin Hagemeister
2023-06-22 16:23:05 +02:00
committed by GitHub
parent e556afb7e0
commit 76d838cf10
+26 -2
View File
@@ -1,3 +1,27 @@
export default function Home() {
return <div />;
import * as path from "https://deno.land/std@0.192.0/path/mod.ts";
const __dirname = path.dirname(path.fromFileUrl(import.meta.url));
const links: string[] = [];
for (const file of Deno.readDirSync(__dirname)) {
if (file.name.startsWith("index")) continue;
const name = path.basename(file.name, path.extname(file.name));
links.push(name);
}
export default function Home() {
return (
<div>
<h1>Tests</h1>
<ul>
{links.map((link) => {
return (
<li key={link}>
<a href={`/${link}`}>{link}</a>
</li>
);
})}
</ul>
</div>
);
}