Skip to content

discovery: populate Squarespace navigation from homepage HTML#65

Open
davipontesblog wants to merge 1 commit into
Automattic:mainfrom
davipontesblog:improvement/squarespace-nav-from-website-json
Open

discovery: populate Squarespace navigation from homepage HTML#65
davipontesblog wants to merge 1 commit into
Automattic:mainfrom
davipontesblog:improvement/squarespace-nav-from-website-json

Conversation

@davipontesblog

Copy link
Copy Markdown

What this changes

squarespaceAdapter.discover() declared const navigation: NavLink[] = [];
with a TODO comment ("we derive nav from the top-level sitemap pages") but
never actually populated it. So every Squarespace migration shipped a WXR
with no nav_menu_items — the destination site started with whatever default
menu the theme provided, and the user had to rebuild the menu manually.

Every other adapter (godaddy-wm, hostinger, hubspot, shopify, webflow)
already imports the shared extractNavLinks(homepageHtml, baseUrl) helper and
calls it after fetching the homepage HTML. Squarespace was the only one
missing that single step.

This PR fetches the homepage HTML and assigns extractNavLinks(html, url) to
navigation. The CDP admin discovery path continues to layer drafts and
unlisted pages on top via mergeAdminDiscovery.

How I found it

While migrating https://www.walkaboutchronicles.com — the imported WXR had
zero menu items even though the source has a 7-item nav. Cross-referenced
with the other adapters to confirm the gap.

Tested against

  • Real site (walkaboutchronicles.com — analogous PHP port)
  • Tests pass (npx vitest run)
  • npx tsc --noEmit clean
  • No new dependencies (reuses shared extractNavLinks)

Discovery log entry added to DISCOVERIES.md

  • Yes

squarespaceAdapter.discover() was declaring 'const navigation: NavLink[]
= []' with a TODO comment but never populating it, so every Squarespace
WXR shipped without a top-nav menu. All other adapters (godaddy-wm,
hostinger, hubspot, shopify, webflow) already fetch homepage HTML +
extractNavLinks(); Squarespace was the only one missing this step.

Found on walkaboutchronicles.com — the imported site started with an
empty default menu even though the source had a 7-item nav.

See DISCOVERIES.md for full context.
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