seo: add canonical URLs to the five public pages (finding 6631c0ab0454) - #29
Conversation
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughFive public pages now declare canonical URLs. ChangesCanonical URL support
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/check-site.mjs`:
- Around line 955-962: The canonical-link validation around head and links must
parse actual link elements across the full document, ignoring commented-out
markup, and recognize single or double quotes plus arbitrary attribute
whitespace. Require exactly one canonical link overall and exactly one within
the head, then retain the existing href validation; add regression cases
covering a body duplicate and comment-only canonical links.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8d13969b-9f64-4f51-abb1-c86a3dc6bb32
📒 Files selected for processing (6)
public/agents.htmlpublic/audit.htmlpublic/index.htmlpublic/pricing.htmlpublic/specimen.htmlscripts/check-site.mjs
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f65f268b9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ["specimen page", read("public/specimen.html"), "https://tinystudio.io/specimen.html"] | ||
| ]; | ||
|
|
||
| const canonicalLinkPattern = /<link\b[^>]*\brel\s*=\s*["']canonical["'][^>]*>/gi; |
There was a problem hiding this comment.
Parse canonical as a relation token
When a page retains the expected tag but gains a conflicting tag such as <link rel="alternate canonical" href="https://other.example/">, the check still passes because this pattern only recognizes a rel value consisting solely of canonical. HTML treats rel as a space-separated token list, so crawlers can still see the second canonical and receive conflicting signals; tokenize the attribute or match canonical at token boundaries so the duplicate guard covers valid multi-token values.
Useful? React with 👍 / 👎.
This branch sat open long enough for four other public-page PRs (#28 heading hierarchy, #30 apple touch icon, #32 schema.org, #33/#34 links) to land on the same five head sections and the same guard script, so every touched file conflicted. Resolution: all six conflicts were additive, not competing. - The five HTML files each gained a <link rel="canonical"> on this branch and icon/og/twitter/JSON-LD tags on main; both sets are kept. - scripts/check-site.mjs was rebuilt from main's version with this branch's 53-line canonical guard inserted verbatim before the migrations loop, rather than by textually merging two overlapping hunks — the first attempt at that spliced a dangling `const canonicalPages = [` and broke the file. intended-outcome: PR #29 becomes mergeable with the canonical guard and every already-landed head guard both enforced. verify: node scripts/check-site.mjs -> "TinyStudio.io checks passed."; npm test -> 15/15; npm run check, test:headings, test:worker all pass. check:render-blocking is not runnable here (playwright is not installed in this worktree) — CI covers it.
There was a problem hiding this comment.
nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fff0121f94
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ["audit page", siteAudit, "https://tinystudio.io/audit.html"], | ||
| ["desk page", read("public/agents.html"), "https://tinystudio.io/agents.html"], | ||
| ["pricing page", read("public/pricing.html"), "https://tinystudio.io/pricing.html"], | ||
| ["specimen page", read("public/specimen.html"), "https://tinystudio.io/specimen.html"] |
There was a problem hiding this comment.
Canonicalize secondary pages to their final clean URLs
When search engines crawl these four pages, the new guard forces each canonical to its .html address even though the internal-link guard immediately above identifies those addresses as redirecting and names /audit, /agents, /pricing, and /specimen as the final clean destinations. Canonical URLs should point directly to those final URLs; otherwise every secondary page emits a canonical-to-redirect signal, and this check prevents correcting the tags.
Useful? React with 👍 / 👎.
…current main and live (#38) The code-side fix (PR #29) and CI enforcement (the 'Canonical URLs (dogfood)' guard in scripts/check-site.mjs) for dogfood finding 6631c0ab0454 ('Missing canonical URL on home') are already merged in origin/main. This lane re-verified the guarantee still holds after the subsequent page edits (internal-link cleanup, App Store citation, sitemap): - npm run check passes on all five public pages: each carries exactly one canonical link in its head, non-empty href, pointing at the absolute https://tinystudio.io address the page is served under (the .html form), no duplicates across pages. - Fresh live measurement of the deployed pages in real Chromium confirms the same: exactly one canonical link per page in head and full document, HTTP 200, production CSP, no console errors — including the home page the finding flagged (https://tinystudio.io/). Nothing further to change; the receipt now records the closeout on the current head so the finding cannot be re-opened by tracker drift.
…nst current GitHub state (#110)
…current main and live (#169) (#170) Re-verified the home-page canonical the finding flagged (PR #29 fix) against origin/main head dc1542a and the deployed site: npm test passes with the check-site.mjs canonical guard, all five public pages serve exactly one canonical link in head in real Chromium, and live matches source byte-for-byte. Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…current main and live (2026-08-14) (#209) Re-verified the home-page canonical the finding flagged (PR #29 fix) against origin/main head 20b7cc6 and the deployed site: npm test passes with the check-site.mjs canonical guard, all five public pages serve exactly one canonical link in head, and live matches source byte-for-byte. Co-authored-by: nish3451 <nish3451@users.noreply.github.com> Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
What
Closes dogfood finding 6631c0ab0454 ("Missing canonical URL on home", audit run 20260808T074205Z-msk2fl3n): the leak audit this site sells flags a homepage whose served HTML carries no canonical URL, and this repo's own home page carried exactly that fault.
Changes
<link rel="canonical">to the head of all five public pages, pointing at the absolutehttps://tinystudio.ioaddress each page is served under (the.htmlform; the worker also serves extensionless twins, so the canonical pins the preferred address):index.html→https://tinystudio.io/audit.html→https://tinystudio.io/audit.htmlagents.html→https://tinystudio.io/agents.htmlpricing.html→https://tinystudio.io/pricing.htmlspecimen.html→https://tinystudio.io/specimen.htmlscripts/check-site.mjs("Canonical URLs (dogfood)" section, mirroring the existing meta-descriptions guard) that failsnpm testif any page drifts: canonical missing, outside the head, duplicated, empty href, wrong URL, or duplicated across pages.Validation
npm run checkpasses with the fix; negative-tested: removing the tag or pointing it at the wrong URL fails the guard.npm testgreen: check + 53 worker tests + 15 UI tests.public/agent-desk.htmlalready carries a canonical (legacy page) and is untouched.Summary by CodeRabbit
SEO Improvements
Quality Assurance