diff --git a/src/routes/+layout.server.js b/src/routes/+layout.server.js index 39388fe..18b735f 100644 --- a/src/routes/+layout.server.js +++ b/src/routes/+layout.server.js @@ -21,6 +21,9 @@ export async function load({ fetch }) { url alt } + favicon { + url + } favicons { size favicon { diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 89c85be..214f969 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -78,6 +78,7 @@ + {#each data.MainInfo.favicons as favicon} diff --git a/src/routes/favicon.ico/+server.js b/src/routes/favicon.ico/+server.js new file mode 100644 index 0000000..f2d9639 --- /dev/null +++ b/src/routes/favicon.ico/+server.js @@ -0,0 +1,13 @@ +import { env } from "$env/dynamic/public"; + +export async function GET() { + const res = await ( + await fetch(env.PUBLIC_SERVER_URL + `/api/globals/main-info`) + ).json(); + const file = await ( + await fetch(env.PUBLIC_SERVER_URL + res.favicon.url) + ).blob(); + const response = new Response(file); + response.headers.set("Content-Type", "image/x-icon"); + return response; +}