Skip to content

improvement(library): rank related posts by tag rarity, add backlinks, and widen comparison and pagination links - #9354

Merged
waleedlatif1 merged 2 commits into
stagingfrom
improvement/library-internal-linking
Oct 23, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
improvement/library-internal-linking

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Related posts ranked by raw tag overlap with a newest-first tiebreak. Sim is on every library post and AI Agents on 120/123, so the list was effectively "the newest posts": 41/123 posts never appeared as related and one post held 46 of the 369 slots
  • New lib/content/links.ts builds a link index once per registry scan: related posts score shared tags and title terms weighted by rarity (a term on more than half the posts weighs zero), plus direct body links between posts, discounted for widely linked hubs. Equal scores break by a per-pair hash, then slug, so the result is deterministic and does not favor one post
  • Library posts show 6 related posts in a responsive grid (1/2/3 columns) instead of a 3-card row
  • The scan also records each post's internal body links, and the reverse index powers a server-rendered "Referenced in" list (up to 6, newest first) on each library post. Related posts skip anything already in that list
  • Comparison ↔ library links: cap raised from 3 to 6. A "{Competitor} Alternatives" title now ranks first, so /comparisons/zapier and /comparisons/n8n lead with their alternatives articles (before, neither listed them). Posts whose body links to /comparisons/<id> now count as matches too. Matching the competitor name in body text was rejected because n8n appears in 113/123 bodies
  • /library and /blog pagination shows numbered page links between Previous and Next. Page 1 links to the bare index instead of ?page=1

Link distribution across 123 published library posts (related-post blocks only, before → after):

Before (3 related) After (6 related + Referenced in)
Posts never linked from another post's blocks 41 0
Most slots held by one post 46 25 (15 from related alone)
Posts with a "Referenced in" list n/a 93
best-zapier-alternatives / n8n-alternatives / langgraph-alternatives related slots 0 / 0 / 0 4 / 8 / 9

For reference, the old algorithm at 6 slots would leave 25 posts never related and give one post 74 slots.

Follow-ups, not in this PR: indexable tag or hub pages, a curated guides block on the homepage, and a site-wide link index so blog posts count as referrers.

Type of Change

  • Improvement

Testing

  • lib/content/links.test.ts (new): link extraction, rarity ranking, and inbound index. The ranking test fails with raw tag-count weights; the inbound test fails without the date sort or the self-link skip
  • app/(landing)/content-routing.test.tsx, lib/content/registry-factory.test.ts pass
  • bun run lint, check:comment-hygiene, check:unused-exports, check:source-conventions, check:file-names, check:boundaries, check:client-boundary, check:utils, check:library-content, check:test-patterns
  • Distribution stats from a read-only script run against the real registry over the current content
  • Type-check, check:audits, and the full test suite run in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 23, 2026 11:17pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 15 files

Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/app/(landing)/library/[slug]/page.tsx Outdated
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issue was found.

Summary

The PR improves links between library posts and comparison pages.

  • Library articles show more useful related links and who cites them.
  • Comparison pages and library articles show more relevant links to each other.
  • Library and blog indexes let readers jump straight to a numbered page.

Since the previous review, the only change excludes all referring posts from related results rather than just the six displayed backlinks. No actionable issue was found in that change or in the full diff’s rule check. No previous review threads were supplied.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Posts[Published posts] --> Index[Shared link index]
  Index --> Related[Rank related posts]
  Index --> Referrers[Find referring posts]
  Referrers --> Backlinks[Show newest six backlinks]
  Referrers --> Exclude[Exclude all referrers]
  Related --> Exclude
  Exclude --> Cards[Show up to six related posts]
Loading

Reviews (2) · Last reviewed commit: "fix(library): keep every referencing pos..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 15 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 4df5d85 into staging Oct 23, 2026
67 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/library-internal-linking branch October 23, 2026 23:30

This branch was previously deployed

1 inactive deployment
Preview — 1bf9993b Deployed Oct 23, 2026 by vercel[bot]
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