mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 05:16:48 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
533235260c
commit
9478ddf70b
2 changed files with 66 additions and 0 deletions
10
public/robots.txt
Normal file
10
public/robots.txt
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
User-agent: *
|
||||||
|
Allow: /
|
||||||
|
Disallow: /painel
|
||||||
|
Disallow: /admin
|
||||||
|
Disallow: /checkout
|
||||||
|
Disallow: /bem-vindo
|
||||||
|
Disallow: /redefinir-senha
|
||||||
|
Disallow: /recuperar-senha
|
||||||
|
|
||||||
|
Sitemap: https://mika.domco.ai/sitemap.xml
|
||||||
56
src/routes/sitemap[.]xml.ts
Normal file
56
src/routes/sitemap[.]xml.ts
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
import { createFileRoute } from "@tanstack/react-router";
|
||||||
|
import type {} from "@tanstack/react-start";
|
||||||
|
|
||||||
|
const BASE_URL = "https://mika.domco.ai";
|
||||||
|
|
||||||
|
interface SitemapEntry {
|
||||||
|
path: string;
|
||||||
|
lastmod?: string;
|
||||||
|
changefreq?: "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never";
|
||||||
|
priority?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Route = createFileRoute("/sitemap.xml")({
|
||||||
|
server: {
|
||||||
|
handlers: {
|
||||||
|
GET: async () => {
|
||||||
|
const today = new Date().toISOString().split("T")[0];
|
||||||
|
const entries: SitemapEntry[] = [
|
||||||
|
{ path: "/", lastmod: today, changefreq: "weekly", priority: "1.0" },
|
||||||
|
{ path: "/login", lastmod: today, changefreq: "monthly", priority: "0.5" },
|
||||||
|
{ path: "/signup", lastmod: today, changefreq: "monthly", priority: "0.7" },
|
||||||
|
{ path: "/termos", lastmod: today, changefreq: "yearly", priority: "0.3" },
|
||||||
|
{ path: "/privacidade", lastmod: today, changefreq: "yearly", priority: "0.3" },
|
||||||
|
{ path: "/reembolso", lastmod: today, changefreq: "yearly", priority: "0.3" },
|
||||||
|
];
|
||||||
|
|
||||||
|
const urls = entries.map((e) =>
|
||||||
|
[
|
||||||
|
` <url>`,
|
||||||
|
` <loc>${BASE_URL}${e.path}</loc>`,
|
||||||
|
e.lastmod ? ` <lastmod>${e.lastmod}</lastmod>` : null,
|
||||||
|
e.changefreq ? ` <changefreq>${e.changefreq}</changefreq>` : null,
|
||||||
|
e.priority ? ` <priority>${e.priority}</priority>` : null,
|
||||||
|
` </url>`,
|
||||||
|
]
|
||||||
|
.filter(Boolean)
|
||||||
|
.join("\n"),
|
||||||
|
);
|
||||||
|
|
||||||
|
const xml = [
|
||||||
|
`<?xml version="1.0" encoding="UTF-8"?>`,
|
||||||
|
`<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">`,
|
||||||
|
...urls,
|
||||||
|
`</urlset>`,
|
||||||
|
].join("\n");
|
||||||
|
|
||||||
|
return new Response(xml, {
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/xml",
|
||||||
|
"Cache-Control": "public, max-age=3600",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue