mirror of
https://github.com/Xevion/dynamic-preauth.git
synced 2025-12-06 09:14:57 -06:00
Set proper site URL, preact devtools, sitemap, robots.txt
This commit is contained in:
@@ -1,13 +1,23 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from "astro/config";
|
||||||
|
import tailwind from "@astrojs/tailwind";
|
||||||
import tailwind from '@astrojs/tailwind';
|
import sitemap from "@astrojs/sitemap";
|
||||||
|
import preact from "@astrojs/preact";
|
||||||
import sitemap from '@astrojs/sitemap';
|
|
||||||
|
|
||||||
import preact from '@astrojs/preact';
|
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
integrations: [tailwind(), sitemap(), preact()]
|
site: process.env.DEV
|
||||||
|
? "https://localhost:4321"
|
||||||
|
: `https://${process.env.RAILWAY_PUBLIC_DOMAIN}`,
|
||||||
|
integrations: [
|
||||||
|
tailwind(),
|
||||||
|
sitemap({
|
||||||
|
changefreq: "monthly",
|
||||||
|
priority: 1.0,
|
||||||
|
// xslURL: "/sitemap.xsl",
|
||||||
|
}),
|
||||||
|
preact({
|
||||||
|
devtools: process.env.DEV != undefined ? true : false,
|
||||||
|
}),
|
||||||
|
],
|
||||||
});
|
});
|
||||||
@@ -4,8 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<meta name="generator" content={Astro.generator} />
|
<title>Dynamic Preauth</title>
|
||||||
<title>Astro Basics</title>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
13
frontend/src/pages/robots.txt.ts
Normal file
13
frontend/src/pages/robots.txt.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import type { APIRoute } from "astro";
|
||||||
|
|
||||||
|
const getRobotsTxt = (sitemapURL: URL) => `
|
||||||
|
User-agent: *
|
||||||
|
Disallow: /download/
|
||||||
|
|
||||||
|
Sitemap: ${sitemapURL.href}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export const GET: APIRoute = ({ site }) => {
|
||||||
|
const sitemapURL = new URL("sitemap-index.xml", site);
|
||||||
|
return new Response(getRobotsTxt(sitemapURL));
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user