I’d love for threads that are not tasks to be publicly indexable by google
I’d love for threads that are not tasks to be publicly indexable by google
Today every thread page ships robots: noindex (lib/site.ts previewMetadata was written for link previews only), and there is no robots.txt or sitemap, so Google can't index anything beyond the landing page.
Plan:
- Define "not a task" server-side the same way the thread page already decides whether to show run chrome (
engaged, thread e028f9e0): a thread is a discussion thread when it has no jobs and no Osebot posts (PRs only ever come from Osebot posts, so that's covered). A thread is indexable when it's a discussion thread AND readable without a session (open workspace, public thread, or no workspace:threadReadable(t, null, false)). lib/previews.ts: ThreadPreview getsengaged+indexable; addlistIndexableThreads()for the sitemap.lib/site.tspreviewMetadata: anindexoption (default stays noindex for workspace manage / invite pages) that flips robots to index,follow and adds a canonical/threads/<id>so?order=newestand#post-…links don't register as duplicates.app/threads/[id]/page.tsxpassesindex: t.indexable.- New
app/robots.ts(allow everything public, disallow /api, /workspaces (manage pages), /join, /signin, /settings, /embed; point at the sitemap) andapp/sitemap.tslisting the indexable threads with lastModified.robots.txt/sitemap.xmlare already reserved slugs in lib/slug.ts.
Task threads, and anything in a private workspace, stay noindex exactly as now.
threadide@1cae5dfDone, pushed as 1cae5df on thread/53aab647.
What changed
- Every thread page used to send
robots: noindex, and there was no robots.txt or sitemap, so nothing but the landing page could be indexed. - Now a thread is indexable when both hold:
- it is a discussion thread: no job was ever queued and Osebot never posted (the same
engagedtest the thread page uses to hide run chrome, so "shows no Osebot stuff" = "Google may index it"); - anyone can read it without signing in: open workspace, public thread, or no workspace.
- it is a discussion thread: no job was ever queued and Osebot never posted (the same
- Indexable threads get
<meta name="robots" content="index, follow">plus a canonical/threads/<id>(so?order=newestand#post-…links don't count as duplicates). Task threads and gated threads staynoindexexactly as before. - New
/robots.txt(allow/; disallow/api/,/workspaces/,/join/,/signin,/settings,/embed/) and/sitemap.xml, built from the DB on each request, listing exactly the indexable threads. A thread drops out of the sitemap the moment someone asks Osebot in it.
Verified with the built app against a sandbox Postgres: discussion thread in an open workspace and a public discussion thread in a private workspace → index,follow + canonical and in the sitemap; task thread (queued job) in an open workspace → readable but noindex, not in the sitemap; private threads → 404 + noindex. tsc and next build pass.
Things to know
- Workspace home pages (
/<slug>) stay noindex; the sitemap handles discovery. If you'd like open workspace homes indexed too, that is a one-lineindex: w.openinapp/[workspace]/page.tsx, say the word. - Vercel preview deployments add
X-Robots-Tag: noindexthemselves, so previews never leak into Google. - Once merged, submit
https://evenings.forum/sitemap.xmlin Google Search Console to get the first crawl going; Google won't pick up a new sitemap quickly on its own. - A thread that was indexed and later becomes a task flips to noindex on the next crawl; Google drops it then, not instantly.
Merged threadide #172 by @osebo (merge, ccbda69).