fix(init): fetch favicon from network like before (#2948)
Reverts back to fetching the favicon from the network. Copying assets from JSR turns out to be difficult. Fixes https://github.com/denoland/fresh/issues/2941
This commit is contained in:
+8
-6
@@ -392,12 +392,14 @@ ${GRADIENT_CSS}`;
|
|||||||
<path d="M14.297 16.49c.985-.747 1.644-1.01 2.099-2.526.566.121.841-.08 1.29-.701.324.466 1.657.608 2.453.701-.715.451-1.057.852-1.452 2.106-1.464-.611-3.167-.302-4.39.42Z" fill="#fff"/>
|
<path d="M14.297 16.49c.985-.747 1.644-1.01 2.099-2.526.566.121.841-.08 1.29-.701.324.466 1.657.608 2.453.701-.715.451-1.057.852-1.452 2.106-1.464-.611-3.167-.302-4.39.42Z" fill="#fff"/>
|
||||||
</svg>`;
|
</svg>`;
|
||||||
await writeFile("static/logo.svg", STATIC_LOGO);
|
await writeFile("static/logo.svg", STATIC_LOGO);
|
||||||
await writeFile(
|
|
||||||
"static/favicon.ico",
|
try {
|
||||||
await Deno.readFile(
|
const res = await fetch("https://fresh.deno.dev/favicon.ico");
|
||||||
new URL(import.meta.resolve("./assets/favicon.ico")),
|
const buf = await res.arrayBuffer();
|
||||||
),
|
await writeFile("static/favicon.ico", new Uint8Array(buf));
|
||||||
);
|
} catch {
|
||||||
|
// Skip this and be silent if there is a network issue.
|
||||||
|
}
|
||||||
|
|
||||||
const MAIN_TS = `import { App, fsRoutes, staticFiles } from "fresh";
|
const MAIN_TS = `import { App, fsRoutes, staticFiles } from "fresh";
|
||||||
import { define, type State } from "./utils.ts";
|
import { define, type State } from "./utils.ts";
|
||||||
|
|||||||
Reference in New Issue
Block a user