Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history

seo.ts

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

seo.tsBlame66 lines · 1 contributor
5618f9aClaude1/**
2 * SEO routes: robots.txt + sitemap.xml.
3 *
4 * robots.txt — allow crawlers on public surfaces, disallow admin/settings
5 * and API write paths.
6 * sitemap.xml — lists the stable public URLs (landing, explore, status,
7 * marketplace, graphql explorer, shortcuts, terms). Public repo URLs are
8 * not enumerated here — those live behind /explore which crawlers follow.
9 */
10
11import { Hono } from "hono";
12
13const seo = new Hono();
14
15const ROBOTS = `User-agent: *
16Allow: /
17Disallow: /admin
18Disallow: /settings
19Disallow: /api/
20Disallow: /login
21Disallow: /register
22Disallow: /logout
23Disallow: /oauth/
24Disallow: /*/settings
25Disallow: /*.git/
26
27Sitemap: /sitemap.xml
28`;
29
30seo.get("/robots.txt", (c) => {
31 c.header("Content-Type", "text/plain; charset=utf-8");
32 c.header("Cache-Control", "public, max-age=3600");
33 return c.body(ROBOTS);
34});
35
36const STATIC_PATHS = [
37 "/",
38 "/explore",
39 "/marketplace",
40 "/status",
80bed05Claude41 "/help",
5618f9aClaude42 "/shortcuts",
43 "/api/graphql",
44 "/terms",
45 "/privacy",
46 "/acceptable-use",
47];
48
49seo.get("/sitemap.xml", (c) => {
50 const origin = new URL(c.req.url).origin;
51 const lastmod = new Date().toISOString().slice(0, 10);
52 const urls = STATIC_PATHS.map(
53 (p) =>
54 `<url><loc>${origin}${p}</loc><lastmod>${lastmod}</lastmod></url>`
55 ).join("\n ");
56 const body = `<?xml version="1.0" encoding="UTF-8"?>
57<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
58 ${urls}
59</urlset>
60`;
61 c.header("Content-Type", "application/xml; charset=utf-8");
62 c.header("Cache-Control", "public, max-age=3600");
63 return c.body(body);
64});
65
66export default seo;