LearnNewsExamplesServices
Frontmatter
id7910
titleEnhancement: Update SEO generator to support middleware-compatible routes
stateClosed
labels
enhancementai
assigneestobiu
createdAtNov 29, 2025, 11:11 AM
updatedAtNov 29, 2025, 12:44 PM
githubUrlhttps://github.com/neomjs/neo/issues/7910
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtNov 29, 2025, 12:41 PM
milestone11.12.0

Enhancement: Update SEO generator to support middleware-compatible routes

Closed v11.12.0 enhancementai
tobiu
tobiu commented on Nov 29, 2025, 11:11 AM

The buildScripts/generateSeoFiles.mjs script needs to be updated to support the new middleware routing strategy.

Currently, the sitemap generator produces hash-based URLs (e.g., https://neomjs.com/#/services), which is suboptimal for SEO. The middleware will handle "real" routes (e.g., https://neomjs.com/services) and map them to client-side routes.

Tasks:

  1. Update getSitemapXml and getLlmsTxt to generate "real routes" (without the hash fragment) for the <loc> tags and content links.
  2. Add a new output format (e.g., json or objects) to the CLI that outputs an array of route objects. Each object should contain:
    • route: The real route (e.g., /services)
    • clientSideRoute: The hash-based route (e.g., /#/services) This will allow the middleware to easily resolve URLs and determine the correct client-side route state.
tobiu added the enhancement label on Nov 29, 2025, 11:11 AM
tobiu added the ai label on Nov 29, 2025, 11:11 AM
tobiu assigned to @tobiu on Nov 29, 2025, 11:11 AM
tobiu referenced in commit adc10e4 - "Enhancement: Update SEO generator to support middleware-compatible routes #7910" on Nov 29, 2025, 12:05 PM
tobiu
tobiu Nov 29, 2025, 12:06 PM

Input from Gemini:

✦ I have refactored the route generation logic in buildScripts/generateSeoFiles.mjs to rely on explicit categories instead of brittle string matching (like .html extensions).

Changes:

  1. Categorized Routes: Routes are now classified as tree (documentation), top-level (SPA pages), or file (examples/apps).
  2. Correct Pathing:
    • file routes (examples) are treated as absolute paths (e.g., /apps/colors/index.html) and do not get prefixed with /learn.
    • Their clientSideRoute is correctly set to an empty string "", as they are standalone entry points, not hash-based routes within the main app.
  3. Verified Output:
    • node buildScripts/generateSeoFiles.mjs --format objects now produces the correct structure:
      {
        "route": "/apps/colors/index.html",
        "clientSideRoute": ""
      }
      
    • Documentation routes (e.g., /learn/benefits/Introduction) are also correctly generated with their corresponding hash-based clientSideRoute (/#/learn/benefits/Introduction).
tobiu closed this issue on Nov 29, 2025, 12:41 PM
tobiu added this to the 11.12.0 milestone on Nov 29, 2025, 12:44 PM