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:
@@ -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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user