chore: add a head component to generated project (#771)

This PR adds a `<Head>` component to projects generated using `init.ts`.
This commit is contained in:
hashrock
2022-09-15 15:00:25 +02:00
committed by GitHub
parent 758b56569a
commit 3b0c4b3b67
+21 -13
View File
@@ -93,22 +93,30 @@ await Deno.writeTextFile(
IMPORT_MAP_JSON,
);
const ROUTES_INDEX_TSX = `import Counter from "../islands/Counter.tsx";
const ROUTES_INDEX_TSX = `import { Head } from "$fresh/runtime.ts";
import Counter from "../islands/Counter.tsx";
export default function Home() {
return (
<div${useTwind ? ` class="p-4 mx-auto max-w-screen-md"` : ""}>
<img
src="/logo.svg"
${useTwind ? `class="w-32 h-32"` : `width="128"\n height="128"`}
alt="the fresh logo: a sliced lemon dripping with juice"
/>
<p${useTwind ? ` class="my-6"` : ""}>
Welcome to \`fresh\`. Try updating this message in the ./routes/index.tsx
file, and refresh.
</p>
<Counter start={3} />
</div>
<>
<Head>
<title>Fresh App</title>
</Head>
<div${useTwind ? ` class="p-4 mx-auto max-w-screen-md"` : ""}>
<img
src="/logo.svg"
${
useTwind ? `class="w-32 h-32"` : `width="128"\n height="128"`
}
alt="the fresh logo: a sliced lemon dripping with juice"
/>
<p${useTwind ? ` class="my-6"` : ""}>
Welcome to \`fresh\`. Try updating this message in the ./routes/index.tsx
file, and refresh.
</p>
<Counter start={3} />
</div>
</>
);
}
`;