Repository navigation
feat(web): serve the docs on mailhooks.cc too, canonical on webhooks.cc (web 0.64.0) - #638
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
…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
force-pushed
the
feat/mailhooks-docs
branch
from
November 10, 2026 14:20
cae4b4a to
1126abf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 otherapp/mailhookspages.next.config.ts: the mail host's/docsrewrites run after the markdown-twin rules. An agent asking mailhooks.cc for markdown (anAcceptheader or.md) gets the same twin as on webhooks.cc./docs.mditself still redirects to webhooks.cc.lib/site.ts:/docsjoinsMAILHOOKS_PREFIXES, so the proxy no longer redirects it.rel="canonical"pointing at the webhooks.cc URL, absolute because the mail layout'smetadataBaseis mailhooks.cc. The mailhooks sitemap leaves the docs out.data-pagefind-body, so the index holds 47 pages, not 94. Results are relative links, so they open on whichever site ran the search.components/docs/doc-page.tsxanddocs-shell.tsx; both routes are now a few lines each.useSitePathname()(lib/site-pathname.ts) drops the/mailhooksprefix that a page prerendered underapp/mailhookssees 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./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.Checks
tscand ESLint are clean. Web unit tests pass; the one local failure issite-top-levelon the ignoredpublic/_pagefindbuild output, which CI does not have. New tests cover the rewrites, twins on the mail host, the proxy andsitePath.webhooks.localhostandmailhooks.localhost):/docs/*with status 200 and the canonical URL on webhooks.cc./docs/nopereturns 404, and/blogredirects to webhooks.cc.mailhooks.spec.ts, with its docs test updated (both styles), andsite-switch.spec.tspass.🤖 Generated with Claude Code