Repository navigation
Old JavaScript docs links go to the utility they pointed at - #13
Merged
Merged
Conversation
The docsify site kept the section in the query string (/utilities?id=isvalidcpf, /pt-br/utilities?id=cep-e-endereço). _redirects sends those to the JavaScript library's page with the ?id= kept, and Google counted 137 of them as alternates of that one page. The library's page now reads the id and replaces the location with the utility's page (and the function's section), from /legacy-ids.json: the JavaScript symbols from the last validator run, the utilities' titles and ids, and the old page's other section headings. An unknown id stays on the library's page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RaUEDkvXY8rVWTJG2GKfhu
|
Preview: https://pr-13.brazilian-utils-docs.pages.dev ( |
public/_worker.js answers the old URLs with a 301 to the utility's page, from /legacy-ids.json. _routes.json limits it to /utilities, /pt-br/utilities and the JavaScript library's pages: every other request stays a static file. The library's page no longer carries a script, and a crawler gets a real redirect in one hop (/utilities?id=isvalidcpf → /utils/cpf/#validate) instead of two plus a JavaScript one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RaUEDkvXY8rVWTJG2GKfhu
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Search Console lists 137 old docsify URLs (
/utilities?id=isvalidcpf,/pt-br/utilities?id=cep-e-endereço, ...) as alternates of the JavaScript library's page:_redirectscannot read a query string, so they all land there./legacy-ids.json(static): old anchor → utility page and section, per language. Built from the JavaScript symbols in the validator's status, the utilities' titles and ids, and the old page's other headings (a fixed list).public/_worker.js(Cloudflare Pages advanced mode) answers those URLs with a 301 to the utility, in one hop._routes.jsonlimits it to/utilities,/pt-br/utilitiesand the JavaScript library's pages; everything else stays a static file. No script on any page.Checked with
wrangler pages devon the build:/utilities?id=isvalidcpf/utils/cpf/#validate/pt-br/utilities?id=cep-e-endereço/pt-br/utils/cep//pt-br/utilities/?id=getcid10/pt-br/utils/cid10/#consultar/libs/javascript/?id=formatCNPJ/utils/cnpj/#format/utilities?id=standard-schema(no utility)/libs/javascript/?id=standard-schema, then 200/utilities,/pt-br/utilities//libs/javascript/,/utils/cpf/,/_headers/guides/schema_redirects, as beforeEvery one of the 616 targets (page and anchor, both languages) exists in the build; 111 of the 125 ids in Search Console's sample map.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RaUEDkvXY8rVWTJG2GKfhu