Skip to content

🤖 Open-source, local-first alternative to Grok Bot, OpenAI dots and Claude Duet. Your own AI bots on any model: GPT, Claude, Gemini, Grok, DeepSeek, Kimi, GLM and 70+ more through one Modelflare key. Reach them in the app, WeChat or Feishu; they remember you, work in the background, run commands and use your computer. Pay per use.

1.0 KB
Raw Blame
// sitemap(§15):首页与附属页的中英文版本,带 hreflang 互指。
import type { APIRoute } from "astro";
import { ORIGIN } from "../lib/site";
import { href, READY_LANGS, LOCALES } from "../i18n";

const PATHS = ["/", "/download", "/security", "/pricing", "/partners", "/bots", "/changelog", "/privacy", "/licenses"];
export const GET: APIRoute = () => {
  const urls = PATHS.flatMap((p) =>
    READY_LANGS.map((lang) => {
      const alt = READY_LANGS.map((l) => `<xhtml:link rel="alternate" hreflang="${LOCALES[l].tag}" href="${ORIGIN}${href(l, p)}"/>`).join("");
      return `<url><loc>${ORIGIN}${href(lang, p)}</loc>${alt}<xhtml:link rel="alternate" hreflang="x-default" href="${ORIGIN}${href("zh", p)}"/></url>`;
    }),
  );
  const xml = `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">\n${urls.join("\n")}\n</urlset>\n`;
  return new Response(xml, { headers: { "Content-Type": "application/xml" } });
};