discovery: populate Squarespace navigation from homepage HTML#65
Open
davipontesblog wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
squarespaceAdapter.discover()declaredconst 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 defaultmenu 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 andcalls 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)tonavigation. The CDP admin discovery path continues to layer drafts andunlisted 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
walkaboutchronicles.com— analogous PHP port)npx vitest run)npx tsc --noEmitcleanextractNavLinks)Discovery log entry added to DISCOVERIES.md