Pass 2 / Phase E — trailing-slash alignment to production#17
Merged
Conversation
… form Eliminates the one-hop /ueber → /ueber/ 307 at the Cloudflare edge by making every URL we emit (canonical link, hreflang alternates, nav hrefs, breadcrumbs, i18n counterpart map, markdown editorial links) match the trailing-slash form Workers Static Assets serves natively. Astro config: trailingSlash 'never' → 'always'. canonicalise() in src/lib/i18n.ts inverts: keeps/adds trailing slash instead of stripping. counterparts map keys and values gain trailing slashes on both sides; the '/' ↔ '/en/' asymmetry is canonical, not a bug. getLocaleFromPath drops the now-dead '=== /en' first condition. Nav component href constants (SiteHeader homeHref/aboutHref/productsHref/contactHref; SiteFooter products/about/contact/legal/privacy) cascade with the *Active reducers simplified accordingly. EN-sibling breadcrumb anchors (/en, /en/products) and product-detail dynamic template-string hrefs on both index pages get the trailing slash. Two markdown editorial contact-page disclosures link to /datenschutz/ and /en/privacy/ for the same reason — the rendered HTML grep surfaced them. Verified locally: npm run check 0-error; npm run build clean; dist/- grep proves zero slash-less internal hrefs survive; canonical and hreflang URLs in built HTML all end in / (including /en/). Astro 6 auto-normalises Astro.url.pathname to the trailing-slash form when the flag is set, so BaseLayout's canonical/og:url emitter needs no source change. Workers Static Assets' default html_handling: "auto-trailing- slash" keeps external /ueber → /ueber/ redirects working at the edge — that is the expected behaviour, not the bug we are fixing. Two-stage integration review (spec-compliance + code-quality, parallel subagents) cleared the diff with non-blocking forward-looking notes (plan-template refinement for markdown editorial files; Pass-3 broadening of E.7's asset-filter blacklist). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…eeea feat(routing): G E flip trailingSlash → always, cascade canonical URL form
blackbrowed-labs
added a commit
that referenced
this pull request
May 12, 2026
Close five Pass 2 backlog rows in one commit; all touch the scripts/ verifier subtree or the verify-cloudflare-facts.yml workflow and all are cosmetic with zero behaviour change. - #17 cwa-retention.mjs: fix JSDoc Source URL drift (data-retention -> faq) so the header comment matches the sourceUrl constant set in G D.10.1. - #18 cwa-retention.mjs: drop dead NUMBER_WORDS entry `twentyfour` (regex never emits the concatenated form) and add `'twenty four'` (regex CAN emit the spaced form via `\s-?` alternation). - #19 dpf.mjs: correct spec section reference from sec 6.3 to the actual load-bearing sections sec 3.2 / 3.4 / 9.1 / 9.3. - #20 verify-cloudflare-facts.yml: PR-body reads naturally for both value-change and absent-from-list cases instead of forcing the DPF-shaped "went absent" framing onto CWA-style figure shifts. - #10 scripts/*.mjs: uniform "Run from the project root" docstring paragraph in build-headers.mjs, extract-tokens.mjs, and run-verifier.mjs (the three top-level scripts surviving after G D.11 deleted check-cloudflare-facts-freshness.mjs); check modules under scripts/checks/ already document the convention via their orchestrator. Perms uniform: no +x bit on any .mjs file. Verifier regression baseline (six MOCK_SCENARIO runs in --dry-run) re-verified post-edit; statuses unchanged. Refs: plans/active/pass-2/backlog.md #10, #17, #18, #19, #20
This was referenced May 12, 2026
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.
Summary
Promotes Phase E (trailing-slash alignment, G6) from dev to main for production rollout. Closes Pass 2 backlog row #1 and completes the Pass 2 phase track (B.1 → B.2 → B.3 → C → D → E).
Phase E itself shipped to dev as PR #16 (merge
f432515); this PR is the dev → main promotion gated by the Phase F staging walkthrough (G7).Changes since main
5c102c3—feat(routing): G E flip trailingSlash → always, cascade canonical URL formf432515— Merge of PR feat(routing): G E flip trailingSlash → always, cascade canonical URL form #16 into devAstro
trailingSlash: 'never'→'always'.canonicalise()insrc/lib/i18n.tsinverts to keep/add slash; counterparts map keys+values all slash-terminal with asymmetric'/' ↔ '/en/'root preserved. Cascade through both nav components (SiteHeader 5 hrefs + SiteFooter 5 hrefs, with*Activereducers simplified), eight page templates' breadcrumb + product-card anchors, and two markdown editorial contact-page disclosure links.getLocaleFromPathdrops the now-deadcanonical === '/en'first condition.14 files / 49 ins / 45 del.
Phase F staging verification — all green
F.1a controller-side technical checks:
/does-not-existand/en/does-not-exist.<script>tags loading the beacon).wrangler.jsoncproduction env hasnot_found_handling: "404-page"..comIONOS MX/SPF/DMARC preserved;.deCloudflare Email Routing intact (established forwarding pipeline, not drift).2026-05-12(per-fact + top-level meta markers refreshed end-to-end through the Phase E build).F.1b Lars-side visual matrix: all states walked and signed off.
Test plan (post-deploy production smoke)
https://blackbrowedlabs.com/return 200 with 0 redirect hops.curl -I https://blackbrowedlabs.com/does-not-existreturns 404 + 404-page body.<script>tag PRESENT on production/datenschutz/+/en/privacy/./datenschutz/.lars@blackbrowedlabs.comdelivers; forwarding from@blackbrowedlabs.deworks.gh workflow view rebuild-nightly.yml --json stateshows "Scheduled" with next-run timestamp.🤖 Generated with Claude Code