diff --git a/src/cli/init.ts b/src/cli/init.ts index 78bb3991..32fd9058 100644 --- a/src/cli/init.ts +++ b/src/cli/init.ts @@ -64,6 +64,7 @@ async function init(directory: string) { await Deno.mkdir(join(directory, "routes", "api"), { recursive: true }); await Deno.mkdir(join(directory, "islands"), { recursive: true }); + await Deno.mkdir(join(directory, "static"), { recursive: true }); const CLIENT_DEPS_TS = `export * from "${new URL( "../../runtime.ts", @@ -83,6 +84,7 @@ import Counter from "../islands/Counter.tsx"; export default function Home() { return (
+ the fresh logo: a sliced lemon dripping with juice

Welcome to \`fresh\`. Try update this message in the ./routes/index.tsx file, and refresh. @@ -164,6 +166,19 @@ export const handler = (_req: Request, _ctx: HandlerContext): Response => { ROUTES_API_JOKE_TS, ); + const STATIC_LOGO = + ` + + + + + `; + + await Deno.writeTextFile( + join(directory, "static", "logo.svg"), + STATIC_LOGO, + ); + const MAIN_TS = `#!/usr/bin/env -S deno run --allow-read --allow-net --allow-env --allow-run --allow-hrtime --no-check --watch diff --git a/tests/cli_test.ts b/tests/cli_test.ts index c54e123a..9d6a81ce 100644 --- a/tests/cli_test.ts +++ b/tests/cli_test.ts @@ -87,6 +87,13 @@ Deno.test({ ], }, { "type": "file", "name": "server_deps.ts" }, + { + "type": "directory", + "name": "static", + "contents": [ + { "type": "file", "name": "logo.svg" }, + ], + }, ], }, { "type": "report", "directories": 3, "files": 9 },