LearnNewsExamplesConnect
Frontmatter
assigneesneo-gemini-julia
createdAtOct 24, 2026, 3:09 AM
updatedAtOct 25, 2026, 2:09 AM
githubUrlhttps://github.com/neomjs/neo/issues/20088
authorneo-gemini-julia
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 25, 2026, 2:09 AM

SEO generator emits doubled /news/blog/blog/ paths in sitemap.xml

Closed v13.4.0/archive-v13-4-0-chunk-3 bugaibuildportal
neo-gemini-julia
neo-gemini-julia commented on Oct 24, 2026, 3:09 AM

Context

While auditing https://neomjs.com/sitemap.xml and buildScripts/docs/seo/generate.mjs (2026-10-24) to diagnose Google Search Console indexing failures with @tobiu, we discovered that all 20 internal blog routes in sitemap.xml and llms.txt carry a doubled /news/blog/blog/<slug> path prefix.

Sweep Attestations (ticket-create §1a):

  • Live latest-open sweep: checked latest 20 open issues in neomjs/neo (#19145–#20086) and neomjs/middleware-v2 (#9–#34) at 2026-10-24T01:07:10Z; no equivalent open ticket found.
  • A2A in-flight claim sweep: checked latest 30 messages (status: 'all'); no competing claim on buildScripts/docs/seo/generate.mjs.
  • MC sweep: query_raw_memories({query: "middleware-v2 Googlebot Search Console sitemap SsrService canonical SEO"}), 10 results; surfaced 7530ffa3-5d88-4ebe-980a-f91fe667082f (2026-10-16), which noticed /news/blog/blog/<slug> in passing after #19503 without filing the double-prefix bug in collectBlogRoutes().
  • Own-assignment sweep: 0 open issues assigned to @neo-gemini-julia in neomjs/neo.

The Problem

  1. In apps/portal/resources/data/blog.json, every internal blog entry stores its id with a leading blog/ prefix, e.g.:
       "id": "blog/where-an-agent-institution-sits"
  2. In buildScripts/docs/seo/generate.mjs:649 (collectBlogRoutes), the generator prepends /news/blog/ directly onto post.id:
       id: `/news/blog/${post.id}`
  3. Likewise, in apps/portal/view/news/blog/MainContainerController.mjs and apps/portal/view/news/blog/Component.mjs, /news/blog is prepended onto blog/<slug> record IDs, emitting doubled /news/blog/blog/<slug> URLs in sitemap.xml, content-routes.json, TreeList links, and sibling blog markdown links (verified live on https://neomjs.com/sitemap.xml: https://neomjs.com/news/blog/blog/where-an-agent-institution-sits, https://neomjs.com/news/blog/blog/a-workspace-that-can-leave-its-window, etc.).

The Architectural Reality

  • Design authority: "Extracts paths for Neo-hosted blog posts (those without a 'publisher' property, meaning they are hosted natively inside the Portal App rather than on external platforms like Medium)." (buildScripts/docs/seo/generate.mjs:626-635)
  • Why apps/portal/resources/data/blog.json stores "id": "blog/<slug>":
    • Neo.app.content.Component#resolveContentId (src/app/content/Component.mjs:195) computes const segments = this.record.id.split('/').slice(0, -1) so "blog/<slug>" provides the 1-folder depth inside learn/ needed for ../guides/... relative links inside learn/blog/*.md to resolve without escaping the root.
    • Therefore, "id": "blog/<slug>" must remain intact in blog.json, while collectBlogRoutes(), Portal.view.news.blog.MainContainerController, and Portal.view.news.blog.Component#resolveContentId normalize routes to /news/blog/<slug> and resolve /news/blog/<slug> (plus legacy /news/blog/blog/<slug>) back to the store's blog/<slug> records.

The Fix

  1. In buildScripts/docs/seo/generate.mjs (collectBlogRoutes):
    • Normalize const slug = post.id.replace(/^blog\//, ''); before constructing /news/blog/${slug} so sitemap.xml and content-routes.json emit canonical /news/blog/<slug> URLs instead of /news/blog/blog/<slug>.
  2. In apps/portal/view/news/blog/MainContainerController.mjs (navigateTo, onRouteItem):
    • Set tree.routePrefix = '/news' so TreeList leaf clicks (${routePrefix}/${record.id}) emit /news/blog/<slug>.
    • Strip leading blog/ in navigateTo(item) and resolve const slug = itemId.split('#')[0].replace(/^blog\//, ''), recordId = store.get(\blog/${slug}`) ? `blog/${slug}` : slug;inonRouteItem({itemId})`.
  3. In apps/portal/view/news/blog/Component.mjs (resolveContentId):
    • Return id.startsWith('blog/') ? \news/${id}` : `learn/${id}`so sibling blog markdown links rewrite to#/news/blog/`.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
collectBlogRoutes() (buildScripts/docs/seo/generate.mjs:626-656) buildScripts/docs/seo/generate.mjs JSDoc Strips leading blog/ from post.id so emitted route id is /news/blog/<slug> Handles post.id with or without leading blog/ JSDoc in generate.mjs Generate.spec.mjs
Portal.view.news.blog.MainContainerController (navigateTo, onRouteItem) apps/portal/view/news/blog/MainContainerController.mjs Emits /news/blog/<slug>, sets tree.routePrefix = '/news', and resolves /news/blog/<slug> to store.get('blog/<slug>') Resolves both /news/blog/<slug> (with #fragment) and legacy /news/blog/blog/<slug> JSDoc in MainContainerController.mjs MainContainerController.spec.mjs
Portal.view.news.blog.Component#resolveContentId (apps/portal/view/news/blog/Component.mjs:34-48) apps/portal/view/news/blog/Component.mjs JSDoc Returns news/${id} when id.startsWith('blog/') so sibling blog links resolve to #/news/blog/<slug> Non-blog learn/ targets continue returning learn/${id} JSDoc in Component.mjs BlogLinks.spec.mjs

Decision Record impact

none

Acceptance Criteria

  • collectBlogRoutes() in buildScripts/docs/seo/generate.mjs strips any leading blog/ prefix from post.id, emitting /news/blog/<slug> instead of /news/blog/blog/<slug>.
  • llms.txt and sitemap.xml generation emit /news/blog/<slug> for all internal blog entries in apps/portal/resources/data/blog.json.
  • Portal route /news/blog/<slug> resolves and renders the corresponding blog post in apps/portal.

Out of Scope

  • External blog posts (entries with post.publisher that link off-site).
  • Sitemap ticket/PR dilution (tracked in sibling ticket #20089).

Avoided Traps

  • Do not strip blog/ inside blog.json without checking whether TreeList or relative link resolution in apps/portal/view/news/blog/Component.mjs depends on record.id starting with blog/; normalizing the route in generate.mjs, MainContainerController.mjs, and Component.mjs preserves the 1-folder relative link depth inside learn/.

Related

  • neomjs/neo#19501
  • neomjs/neo#19503

unowned-rationale: Filed upfront during operator-directed SEO/Search Console root-cause audit; implementation deferred until after current memory-restoration and neo-stage architecture lanes. Origin Session ID: 7bbb249d-903b-4ad7-b69c-658b286ce4a0 Retrieval Hint: "collectBlogRoutes /news/blog/blog/ generate.mjs blog.json"

tobiu referenced in commit 2e51fb1 - "fix(seo): strip doubled blog/ prefix from portal and sitemap blog routes (#20088) (#20096)" on Oct 25, 2026, 2:09 AM
tobiu closed this issue on Oct 25, 2026, 2:09 AM