From 2978ba787dbb2b4b1dfda73b27f3756a8f79575c Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Sun, 24 May 2026 22:05:37 -0700 Subject: [PATCH 1/2] Add robots.txt and sitemap.xml.gz for SEO Adds a static robots.txt blocking admin/API/auth routes, a sitemap generation script (scripts/generate-sitemap.mjs) that writes both sitemap.xml and sitemap.xml.gz to public/, and hooks it into the build so the sitemap is always fresh on deploy. Co-Authored-By: Claude Sonnet 4.6 --- package.json | 3 ++- public/robots.txt | 10 +++++++++ public/sitemap.xml | 39 ++++++++++++++++++++++++++++++++++ public/sitemap.xml.gz | Bin 0 -> 276 bytes scripts/generate-sitemap.mjs | 40 +++++++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 public/robots.txt create mode 100644 public/sitemap.xml create mode 100644 public/sitemap.xml.gz create mode 100644 scripts/generate-sitemap.mjs diff --git a/package.json b/package.json index 00184e8..ef28a85 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,9 @@ "private": true, "type": "module", "scripts": { - "build": "npm run build:remix && npm run build:server", + "build": "npm run sitemap && npm run build:remix && npm run build:server", "build:remix": "react-router build", + "sitemap": "node scripts/generate-sitemap.mjs", "build:server": "node scripts/build-server.mjs", "db:generate": "dotenv -- drizzle-kit generate", "db:migrate": "dotenv -- drizzle-kit migrate", diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..c32db83 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,10 @@ +User-agent: * +Allow: / + +Disallow: /admin/ +Disallow: /api/ +Disallow: /onboarding +Disallow: /settings +Disallow: /user-profile + +Sitemap: https://brackt.com/sitemap.xml.gz diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..b6a4162 --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,39 @@ + + + + https://brackt.com/ + 2026-05-25 + weekly + 1.0 + + + https://brackt.com/how-to-play + 2026-05-25 + monthly + 0.8 + + + https://brackt.com/rules + 2026-05-25 + monthly + 0.8 + + + https://brackt.com/sports + 2026-05-25 + weekly + 0.8 + + + https://brackt.com/support + 2026-05-25 + monthly + 0.6 + + + https://brackt.com/privacy-policy + 2026-05-25 + yearly + 0.4 + + diff --git a/public/sitemap.xml.gz b/public/sitemap.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..a29fde1709434f7f5f0077d12fbf6f1186cb2bcb GIT binary patch literal 276 zcmV+v0qg!BiwFP!000001I^OiPQxG+2k`qo1?fE;*0^OZl->CR`T)qVCF4t=>-zQv zSB)3OCN(BropAV{ zTlYDK1Hd?rBy`;o`>6B8H-s|yJQWShoMl$; zN1QzlMog=P*1O#QOr&JLnivP8(tpLJ;A38|TYlVM;f7Fnf4jTgYF>!?BIJaFH(IX$ aev=Y$33>M|^1URLdG!Y3m0 + +${urls + .map( + ({ loc, changefreq, priority }) => ` + ${BASE_URL}${loc} + ${today} + ${changefreq} + ${priority} + ` + ) + .join("\n")} + +`; + +writeFileSync(join(publicDir, "sitemap.xml"), xml); +writeFileSync(join(publicDir, "sitemap.xml.gz"), gzipSync(xml)); + +console.log(`Sitemap generated: ${urls.length} URLs`); From 8e732960677d6cacb4ed49abc60019ca386aebda Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Sun, 24 May 2026 22:16:49 -0700 Subject: [PATCH 2/2] Fix robots.txt and sitemap issues from code review - Point Sitemap directive at /sitemap.xml (not .gz) so crawlers receive plain XML without needing Content-Encoding headers - Add Disallow: /leagues/ to block all auth-gated league routes - Gitignore public/sitemap.xml* so they are always generated fresh at build time rather than serving a stale committed snapshot Co-Authored-By: Claude Sonnet 4.6 --- .gitignore | 4 ++++ public/robots.txt | 3 ++- public/sitemap.xml | 39 --------------------------------------- public/sitemap.xml.gz | Bin 276 -> 0 bytes 4 files changed, 6 insertions(+), 40 deletions(-) delete mode 100644 public/sitemap.xml delete mode 100644 public/sitemap.xml.gz diff --git a/.gitignore b/.gitignore index 68ebecb..5f9cedf 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,7 @@ storybook-static # Clerk migration export — contains password hashes, never commit exported_users.csv + +# Generated at build time by scripts/generate-sitemap.mjs +/public/sitemap.xml +/public/sitemap.xml.gz diff --git a/public/robots.txt b/public/robots.txt index c32db83..aa7e420 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -3,8 +3,9 @@ Allow: / Disallow: /admin/ Disallow: /api/ +Disallow: /leagues/ Disallow: /onboarding Disallow: /settings Disallow: /user-profile -Sitemap: https://brackt.com/sitemap.xml.gz +Sitemap: https://brackt.com/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml deleted file mode 100644 index b6a4162..0000000 --- a/public/sitemap.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - https://brackt.com/ - 2026-05-25 - weekly - 1.0 - - - https://brackt.com/how-to-play - 2026-05-25 - monthly - 0.8 - - - https://brackt.com/rules - 2026-05-25 - monthly - 0.8 - - - https://brackt.com/sports - 2026-05-25 - weekly - 0.8 - - - https://brackt.com/support - 2026-05-25 - monthly - 0.6 - - - https://brackt.com/privacy-policy - 2026-05-25 - yearly - 0.4 - - diff --git a/public/sitemap.xml.gz b/public/sitemap.xml.gz deleted file mode 100644 index a29fde1709434f7f5f0077d12fbf6f1186cb2bcb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 276 zcmV+v0qg!BiwFP!000001I^OiPQxG+2k`qo1?fE;*0^OZl->CR`T)qVCF4t=>-zQv zSB)3OCN(BropAV{ zTlYDK1Hd?rBy`;o`>6B8H-s|yJQWShoMl$; zN1QzlMog=P*1O#QOr&JLnivP8(tpLJ;A38|TYlVM;f7Fnf4jTgYF>!?BIJaFH(IX$ aev=Y$33>M|^1URLdG!Y3m0