← Back to overview

Socrates Documentation

Internal Linking

How the link map drives and records internal links.

Internal Linking

Linking is driven by the client's Internal Linking Webmap doc, which is loaded before drafting and appended to after every approved piece. Two jobs: pick good destinations during the Optimized Draft, then log the new edges after the Final Draft.

Source of link destinations (priority order)

  1. Internal Linking Webmap (primary) — the maintained link graph. Use it to see what pages exist, what's already linked, what's over-linked, and which pages are orphaned/under-linked and worth pointing to.
  2. Screaming Frog CSV (if uploaded, Flood's standard) — refresh/extend the candidate set. Keep only 200-status, Indexable rows; use Title 1/H1-1 as the topic signal; drop noindex, redirects, 4xx/5xx, parameter and non-content URLs.
  3. Live crawl (crawl_site) — if no Webmap or CSV yet, build the candidate URL → topic table from page H1s/titles.

If none yields usable URLs, draft without internal links and flag it — never invent client URLs.

Placement rules (Optimized Draft)

Link report (per draft, in delivery)

List every internal link inserted as anchor text → destination URL so the requester can confirm each resolves and points where intended.

Webmap update (after Final Draft approved)

Append to the Webmap Sheet via socrates_append_webmap_rows: - One edge row per link placed: source = this piece's URL/slug, destination, anchor text, added by = this article, date. - Any inbound-link opportunities this piece creates (existing pages that should now link to it) and refreshed orphan/under-linked notes go in the Webmap Notes tab.

The Sheet append is atomic — no rewrite, no duplicate doc. If Socrates is unreachable, emit the new rows in an update packet for paste-back (output-format.md).