Skip to content

feat(seo): prevent direct indexing of the standalone build #106

Closed

Description

@Ardnived

Summary

Product direction (confirmed):

Search is owned by WeMeditate and other embedded sites. sahajatlas.com should resist direct indexing.

The standalone build is a real SEO surface today: proper schema.org/Event JSON-LD, canonical + OG tags per event (src/components/molecules/EventMetadata/EventMetadata.tsx:87-100), rendered only in the standalone build (src/views/EventView/EventView.tsx:77 — {standalone && <EventMetadata event={event} />}; region/country views emit their own). The canonicals already point at SahajCloud's webUrl — the WeMeditate surface — so standalone is deliberately a pointer to the canonical surface, not the surface itself. But nothing prevents indexing: no robots.txt, no noindex, no X-Robots-Tag (.claude/reports/RELEASE_READINESS.md §6, Appendix D — "No robots.txt / sitemap.xml"; public/ today holds only _redirects, favicons, graphics, locales, logo.svg, social). Since search is owned by the embedding sites, the standalone deployment should actively resist direct indexing — while keeping share unfurls working.

Proposed changes

  • public/robots.txt (new) with User-agent: * / Disallow: /.
  • A crawlable noindex signal: <meta name="robots" content="noindex"> in the standalone Helmet head (gated on standalone, like all existing SEO output) and/or an X-Robots-Tag: noindex response header via a Cloudflare Pages public/_headers file — the implementer picks the reliable combination. Note the interaction: a robots.txt Disallow hides the page-level noindex from crawlers, so a URL blocked by robots.txt can still be indexed (URL-only) from external links. Either serve the noindex where crawlers can fetch it, or accept and document the residual risk. public/_redirects is the existing precedent for repo-controlled Pages config read from dist/.
  • KEEP the JSON-LD / OG output — link unfurls in shares must keep working. noindex does not break OG previews (share scrapers fetch the page directly and don't apply robots indexing directives to preview rendering) — verify against the deployed preview and state it in the implementation report.
  • KEEP canonicals pointing at webUrl (the WeMeditate surface).
  • Decide and state whether sahajatlas-design.pages.dev (the Ladle playground, its own Cloudflare Pages project) needs the same treatment.
  • The embed path must be untouched: the widget must never inject robots meta into a host page's <head> (keep everything behind the standalone gate — src/config/mode.ts:4-6).

Acceptance criteria

  • public/robots.txt with Disallow: / ships in dist/ (verified in a production build output).
  • The standalone build serves a noindex signal a crawler can actually see (meta robots in the standalone head and/or X-Robots-Tag via public/_headers); the chosen combination and its robots.txt interaction are documented in the implementation report.
  • The embedded widget emits no robots meta into the host page (gate on standalone verified).
  • JSON-LD, OG tags and canonicals (→ webUrl) are unchanged; a share-link unfurl still renders title/description/image (checked against the Cloudflare preview or a scraper debugger), and the "noindex doesn't break OG previews" claim is verified and stated.
  • A decision on sahajatlas-design.pages.dev is stated in the issue/PR (and implemented if "yes").
  • Lint + typecheck + pnpm test:run + pnpm build pass.
  • Write an implementation report to .claude/reports/<issue-number>-<short-slug>.md — in the MAIN checkout at /Users/devindra/Documents/Projects/SahajAtlasWeb even when implementing from a worktree (the folder is gitignored) — covering what changed, what was deliberately NOT changed, and which readiness-report findings are resolved.

Files affected

  • public/robots.txt (new)
  • public/_headers (new, if the header route is chosen)
  • The standalone Helmet head block (src/App.tsx standalone region or src/components/molecules/EventMetadata/EventMetadata.tsx) — keep it surgical; sibling tickets own other regions of App.tsx

Parallel implementation: this ticket OWNS the files listed above; sibling release-hardening tickets run concurrently — avoid edits outside owned files except strictly additive ones.

References

  • .claude/reports/RELEASE_READINESS.md §6 (SEO), Appendix D
  • public/_redirects — precedent for repo-controlled Cloudflare Pages config
  • src/config/mode.ts:4-6 (standalone vs embed semantics — hash URLs are not canonical)
  • docs(widget): publish an accurate integrator guide #93 (integrator guide — the docs surface if the map/robots decision needs host-facing wording)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Hold Until

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions