diff --git a/src/app.ts b/src/app.ts index cbb4bd0..1304a53 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,5 +1,5 @@ export const AppConfig = { - site: import.meta.env.SITE, + site: 'https://shrjamal.github.io/2048-3x3', site_name: '2048.club', title: '2048 3x3', description: 'Play 2048 3x3 Game online for free and record your best score', diff --git a/src/pages/robots.txt.ts b/src/pages/robots.txt.ts index b6b1dc9..e17cf0b 100644 --- a/src/pages/robots.txt.ts +++ b/src/pages/robots.txt.ts @@ -1,10 +1,12 @@ import type { APIRoute } from 'astro' +import { AppConfig } from '~/app' export const GET: APIRoute = async () => { return new Response( ` User-agent: * Allow: / + Sitemap: ${AppConfig.site}/sitemap.xml `, { headers: { diff --git a/src/pages/sitemap.xml.ts b/src/pages/sitemap.xml.ts index b649f7e..36678b3 100644 --- a/src/pages/sitemap.xml.ts +++ b/src/pages/sitemap.xml.ts @@ -1,6 +1,6 @@ import type { APIRoute } from 'astro' +import { AppConfig } from '~/app' -const SITE = 'https://shrjamal.github.io/2048-3x3' export const GET: APIRoute = async () => { return new Response( ` @@ -29,7 +29,7 @@ function getXMLEntry({ }) { return ` - ${SITE}${path} + ${AppConfig.site}${path} ${lastmod ? `${new Date(lastmod).toISOString()}` : ''} ${changeFreq ? `${changeFreq}` : ''} ${priority ? `${priority}` : ''}