From 63370462121c61e3e218699dc26bf1be4a367c29 Mon Sep 17 00:00:00 2001 From: Heidi Date: Sat, 20 Jun 2026 00:53:54 +0100 Subject: [PATCH] ai generated solutions to our ai generated problems --- frontend/index.html | 1 + server.cjs | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/frontend/index.html b/frontend/index.html index eefd45b..89dcf1f 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -84,6 +84,7 @@ + __TSS_PRELOAD_LINKS__ diff --git a/server.cjs b/server.cjs index abee758..3104151 100644 --- a/server.cjs +++ b/server.cjs @@ -2329,6 +2329,26 @@ function routeStructuredData(origin, seo, canonicalUrl) { ]) } +function routePreloadLinks(pathname) { + const hrefs = [] + + if (pathname === '/') { + hrefs.push('/api/tss/leaderboard/teams?limit=4') + hrefs.push('/api/tss/games/recent?limit=50') + } else if (pathname === '/teams') { + hrefs.push('/api/tss/leaderboard/teams?limit=100') + } else if (pathname === '/players') { + hrefs.push('/api/tss/leaderboard/players?limit=100') + } else if (pathname === '/battle-logs' || pathname === '/live') { + hrefs.push('/api/tss/games/recent?limit=50') + hrefs.push('/api/tss/leaderboard/teams?limit=100') + } + + return hrefs + .map((href) => ``) + .join('\n ') +} + function htmlWithSeo(req, data) { const origin = pagePublicOrigin(req) let pathname = '/' @@ -2349,6 +2369,7 @@ function htmlWithSeo(req, data) { .replaceAll('__SEO_ROBOTS__', escapeHtml(seo.robots)) .replaceAll('__SEO_CANONICAL__', escapeHtml(canonicalUrl)) .replaceAll('__SEO_JSON_LD__', routeStructuredData(origin, seo, canonicalUrl).replace(/