diff options
| author | Adam Soltys <[email protected]> | 2026-11-16 12:35:03 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-11-16 12:35:03 -0700 |
| commit | eada69879cee323c6da497fd6cf5899325827c8e (patch) | |
| tree | 46a9958bc1993223f2ea5fbaca7eb7f3204a0cf3 | |
| parent | a5ff626228b35ef587f6b9493998184e3e8354fe (diff) | |
| download | coinos-ui-eada69879cee323c6da497fd6cf5899325827c8e.tar.gz coinos-ui-eada69879cee323c6da497fd6cf5899325827c8e.zip | |
Google listed /settings/shopify as "Untitled" instead of the homepage
"When searching for "coinos" on Google right now, the top result points to
https://coinos.io/settings/shopify with the page title "Untitled"" (Oliver,
2026-11-15). Pages render client-side only, so the HTML crawlers get had no
<title>, and the settings layout's redirect for signed-out visitors only ran in
the browser: /settings/shopify answered 200 with an empty shell.
- app.html carries <title>coinos</title> as a fallback; Svelte 5 sets
document.title, so per-page titles still replace it.
- hooks.server.ts sends signed-out GETs under /settings to
/register?redirect=... with a real 307.
- WebSite/Organization JSON-LD tells Google coinos.io is a website, to favour a
normal result over the business-listing card.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
| -rw-r--r-- | src/app.html | 20 | ||||
| -rw-r--r-- | src/hooks.server.ts | 15 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/app.html b/src/app.html index 32cbd31e..e1f573f2 100644 --- a/src/app.html +++ b/src/app.html @@ -2,6 +2,7 @@ <html lang="en"> <head> <meta charset="utf-8" /> + <title>coinos</title> <link rel="icon" href="/favicon.ico" /> <meta name="viewport" @@ -17,6 +18,25 @@ <meta name="mobile-web-app-status-bar-style" content="black-translucent" /> <link rel="apple-touch-icon" href="/images/icon-160.png" /> <link rel="manifest" href="/manifest.webmanifest" /> + <script type="application/ld+json"> + { + "@context": "https://schema.org", + "@graph": [ + { + "@type": "WebSite", + "name": "coinos", + "url": "https://coinos.io/" + }, + { + "@type": "Organization", + "name": "coinos", + "url": "https://coinos.io/", + "logo": "https://coinos.io/images/icon-160.png", + "sameAs": ["https://x.com/coinoswallet"] + } + ] + } + </script> %sveltekit.head% </head> <body data-sveltekit-preload-data="hover"> diff --git a/src/hooks.server.ts b/src/hooks.server.ts index bd9bbc01..5e0d9e90 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -5,6 +5,21 @@ import type { Handle } from "@sveltejs/kit"; setIpGetter(() => ipStore.getStore()); export const handle: Handle = async ({ event, resolve }) => { + // Pages render client-side only, so the settings layout's login redirect + // never reaches crawlers; Google indexed /settings/shopify as an empty + // "Untitled" page. Redirect signed-out visitors on the server instead. + const { pathname } = event.url; + if ( + event.request.method === "GET" && + !event.cookies.get("token") && + (pathname === "/settings" || pathname.startsWith("/settings/")) && + !event.isDataRequest + ) + return new Response(null, { + status: 307, + headers: { location: `/register?redirect=${pathname}` }, + }); + const ip = event.request.headers.get("cf-connecting-ip") || event.request.headers.get("x-forwarded-for")?.split(",")[0]?.trim() || |
