Skip to content

feat(web): serve the docs on mailhooks.cc too, canonical on webhooks.cc (web 0.64.0) - #638

Merged
kroqdotdev merged 3 commits into
mainfrom
feat/mailhooks-docs
Nov 10, 2026
Merged

kroqdotdev merged 3 commits into
mainfrom
feat/mailhooks-docs

Conversation

@kroqdotdev

Copy link
Copy Markdown
Owner

Why

Reviewers kept asking that mail-first visitors not be sent to webhooks.cc to read the docs. This keeps one copy with one canonical URL and serves it on both hosts.

What

  • app/mailhooks/docs/[[...slug]] renders the same MDX at the same paths on mailhooks.cc, under the mailhooks header and footer. It is prerendered like the other app/mailhooks pages.
  • next.config.ts: the mail host's /docs rewrites run after the markdown-twin rules. An agent asking mailhooks.cc for markdown (an Accept header or .md) gets the same twin as on webhooks.cc. /docs.md itself still redirects to webhooks.cc.
  • lib/site.ts: /docs joins MAILHOOKS_PREFIXES, so the proxy no longer redirects it.
  • SEO: every mailhooks.cc docs page has rel="canonical" pointing at the webhooks.cc URL, absolute because the mail layout's metadataBase is mailhooks.cc. The mailhooks sitemap leaves the docs out.
  • Search: only webhooks.cc's copy has data-pagefind-body, so the index holds 47 pages, not 94. Results are relative links, so they open on whichever site ran the search.
  • The doc page and layout move into components/docs/doc-page.tsx and docs-shell.tsx; both routes are now a few lines each.
  • useSitePathname() (lib/site-pathname.ts) drops the /mailhooks prefix that a page prerendered under app/mailhooks sees on the server. The header, docs sidebar and breadcrumbs use it, so their active states are already right in the prerendered HTML and hydration has nothing to correct.
  • On mailhooks.cc, these now link to the local docs: the header's Docs link (it starts at email capture and is marked active anywhere under /docs), the footer, Guides, the feature pages, the sender pages and Integrations. The docs' sign-up box speaks to email there and points to the layout gallery instead of a guest URL, because guest endpoints get no mail.
  • AGENTS.md records the decision.

Checks

  • tsc and ESLint are clean. Web unit tests pass; the one local failure is site-top-level on the ignored public/_pagefind build output, which CI does not have. New tests cover the rewrites, twins on the mail host, the proxy and sitePath.
  • Production build with both sites configured (webhooks.localhost and mailhooks.localhost):
    • The mail host serves /docs/* with status 200 and the canonical URL on webhooks.cc.
    • /docs/nope returns 404, and /blog redirects to webhooks.cc.
    • The prerendered HTML already marks the right header link, sidebar item and breadcrumb.
    • No console errors.
    • The search index has 47 pages.
  • Playwright against that build: mailhooks.spec.ts, with its docs test updated (both styles), and site-switch.spec.ts pass.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1c727fc3-74de-4245-aa23-297e776a0a8c
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

Copy link
Copy Markdown

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

kroqdotdev and others added 3 commits November 10, 2026 15:19
…cc (web 0.64.0)

Mail-first visitors were sent to webhooks.cc for every docs link.
app/mailhooks/docs now renders the same MDX at the same paths on
mailhooks.cc, under its header and footer, through host rewrites placed
after the markdown twins (so an agent gets the same twin on either host).
Each page's canonical URL stays on webhooks.cc, the mail sitemap leaves the
docs out, and only webhooks.cc's copy goes into the search index.

The doc page and layout move into components/docs (doc-page.tsx,
docs-shell.tsx) so both routes share them. Client components read the path
through useSitePathname(), which drops the /mailhooks prefix a page
prerendered under app/mailhooks sees on the server, so active links and
breadcrumbs hydrate without a mismatch. mailhooks.cc's header, footer,
Guides and feature pages link to the local docs, and the docs' sign-up box
speaks to email there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A doc that does not exist on mailhooks.cc gets mailhooks.cc's own 404
  instead of webhooks.cc's: the proxy marks /docs paths the docs nav does
  not list, and a test keeps the nav equal to content/docs.
- Links in the docs to pages only webhooks.cc has (installation, the blog,
  comparisons) go straight to webhooks.cc on mailhooks.cc (SiteLink), rather
  than a client fetch the cross-origin redirect makes fail first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The docs are on both sites now, so switching from /docs/... opens the same
doc on the other site, signed in or out (sharedPublicPath in
lib/site-switch-client.ts, beside the home and pricing pages).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kroqdotdev
kroqdotdev merged commit ba77c33 into main Nov 10, 2026
29 checks passed
@kroqdotdev
kroqdotdev deleted the feat/mailhooks-docs branch November 10, 2026 14:31
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant