Skip to content

seo: add canonical URLs to the five public pages (finding 6631c0ab0454) - #29

Merged
nish3451 merged 3 commits into
mainfrom
fix/canonical-urls
Aug 9, 2026
Merged

seo: add canonical URLs to the five public pages (finding 6631c0ab0454)#29
nish3451 merged 3 commits into
mainfrom
fix/canonical-urls

Conversation

@nish3451

@nish3451 nish3451 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

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

  • Add <link rel="canonical"> to the head of all five public pages, pointing at the absolute https://tinystudio.io address each page is served under (the .html form; the worker also serves extensionless twins, so the canonical pins the preferred address):
    • index.htmlhttps://tinystudio.io/
    • audit.htmlhttps://tinystudio.io/audit.html
    • agents.htmlhttps://tinystudio.io/agents.html
    • pricing.htmlhttps://tinystudio.io/pricing.html
    • specimen.htmlhttps://tinystudio.io/specimen.html
  • Add a source-string CI guard in scripts/check-site.mjs ("Canonical URLs (dogfood)" section, mirroring the existing meta-descriptions guard) that fails npm test if any page drifts: canonical missing, outside the head, duplicated, empty href, wrong URL, or duplicated across pages.

Validation

  • npm run check passes with the fix; negative-tested: removing the tag or pointing it at the wrong URL fails the guard.
  • npm test green: check + 53 worker tests + 15 UI tests.
  • public/agent-desk.html already carries a canonical (legacy page) and is untouched.

Summary by CodeRabbit

  • SEO Improvements

    • Added canonical URLs to key site pages to help search engines identify preferred page addresses and reduce duplicate indexing.
  • Quality Assurance

    • Added automated checks to verify canonical links are present, unique, valid, and correctly formatted.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eb07afc3-9d74-4e65-9533-ab0482730853

📥 Commits

Reviewing files that changed from the base of the PR and between b9be0e6 and fff0121.

📒 Files selected for processing (6)
  • public/agents.html
  • public/audit.html
  • public/index.html
  • public/pricing.html
  • public/specimen.html
  • scripts/check-site.mjs
🚧 Files skipped from review as they are similar to previous changes (6)
  • public/agents.html
  • public/pricing.html
  • public/audit.html
  • public/index.html
  • public/specimen.html
  • scripts/check-site.mjs

📝 Walkthrough

Walkthrough

Five public pages now declare canonical URLs. scripts/check-site.mjs validates the canonical links for presence, location, format, expected values, and uniqueness.

Changes

Canonical URL support

Layer / File(s) Summary
Canonical URL metadata
public/index.html, public/agents.html, public/audit.html, public/pricing.html, public/specimen.html
Each page adds one absolute canonical link in its document head.
Canonical URL regression checks
scripts/check-site.mjs
The site checks validate one live canonical link per page, head placement, quote-format flexibility, comment exclusion, a non-empty absolute URL, the expected page URL, and unique URLs across pages.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding canonical URLs to five public pages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/canonical-urls

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a76dba4 and b9be0e6.

📒 Files selected for processing (6)
  • public/agents.html
  • public/audit.html
  • public/index.html
  • public/pricing.html
  • public/specimen.html
  • scripts/check-site.mjs

Comment thread scripts/check-site.mjs Outdated

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/check-site.mjs
["specimen page", read("public/specimen.html"), "https://tinystudio.io/specimen.html"]
];

const canonicalLinkPattern = /<link\b[^>]*\brel\s*=\s*["']canonical["'][^>]*>/gi;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nish3451 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/check-site.mjs
Comment on lines +1297 to +1300
["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"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@nish3451
nish3451 merged commit a163327 into main Aug 9, 2026
3 checks passed
nish3451 added a commit that referenced this pull request Aug 9, 2026
…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.
nish3451 added a commit that referenced this pull request Aug 11, 2026
nish3451 added a commit that referenced this pull request Aug 13, 2026
…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>
nish3451 added a commit that referenced this pull request Aug 14, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant