feat: _app (#87)

Co-authored-by: Luca Casonato <hello@lcas.dev>
This commit is contained in:
Leo Kettmeir
2022-02-18 19:30:24 +01:00
committed by GitHub
co-authored by Luca Casonato
parent 2ec980ca45
commit 04a32f3498
8 changed files with 67 additions and 5 deletions
+15
View File
@@ -0,0 +1,15 @@
/** @jsx h */
/** @jsxFrag Fragment */
import { AppProps, Fragment, h, Head } from "../deps.ts";
export default function App(props: AppProps) {
return (
<>
<Head>
<meta name="description" content="Hello world!" />
</Head>
<props.Component />
</>
);
}
+2
View File
@@ -16,6 +16,7 @@ import * as $10 from "./pages/_500.tsx";
import * as $11 from "./pages/intercept.tsx";
import * as $12 from "./pages/_404.tsx";
import * as $13 from "./pages/[name].tsx";
import * as $14 from "./pages/_app.tsx";
const routes = {
pages: {
@@ -33,6 +34,7 @@ const routes = {
"./pages/intercept.tsx": $11,
"./pages/_404.tsx": $12,
"./pages/[name].tsx": $13,
"./pages/_app.tsx": $14,
},
baseUrl: import.meta.url,
};
+4
View File
@@ -24,6 +24,10 @@ Deno.test("/ page prerender", async () => {
body,
`"data":[["home","Hello!"]]`,
);
assertStringIncludes(
body,
`<meta name="description" content="Hello world!" />`,
);
});
Deno.test("/props/123 page prerender", async () => {