first commit

This commit is contained in:
Troy 2024-12-23 21:18:55 +00:00
commit ff7c974867
Signed by: troy
GPG key ID: DFC06C02ED3B4711
227 changed files with 12908 additions and 0 deletions

15
src/pages/robots.txt.ts Normal file
View file

@ -0,0 +1,15 @@
import type { APIRoute } from "astro";
const getRobotsTxt = (sitemapURL: URL) => `
User-agent: *
Disallow: /cv
Disallow: /privacy
Allow: /
Sitemap: ${sitemapURL.href}
`;
export const GET: APIRoute = ({ site }) => {
const sitemapURL = new URL("sitemap-index.xml", site);
return new Response(getRobotsTxt(sitemapURL));
};