LearnNewsExamplesServices
Frontmatter
id7448
titleCreate DocumentHead Addon with Canonical URL Support
stateClosed
labels
enhancementai
assigneestobiu
createdAtOct 10, 2025, 10:09 PM
updatedAtNov 11, 2025, 11:59 AM
githubUrlhttps://github.com/neomjs/neo/issues/7448
authortobiu
commentsCount2
parentIssue7446
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtNov 11, 2025, 11:59 AM

Create DocumentHead Addon with Canonical URL Support

Closed v11.1.0 enhancementai
tobiu
tobiu commented on Oct 10, 2025, 10:09 PM

To solve the critical duplicate content issue caused by the SPA architecture and multiple deployment environments (dev, prod, esm), a main thread addon is required to dynamically manage the document's <head>.

This is the highest priority task for the SEO epic, as it enables crawlers like Google to correctly index our content by providing a canonical URL.

Acceptance Criteria

  1. Create a new main thread addon at src/main/addon/DocumentHead.mjs.
  2. The addon must expose the following RMA methods:
    • setTitle(newTitle): Updates the content of the <title> tag.
    • setTag(tagObject): A smart method that creates or updates a <meta> or <link> tag. It should remove any existing tag with the same name or property before adding the new one.
    • setCanonical(url): A dedicated method that creates or updates the <link rel="canonical" href="..."> tag.
  3. The portal application controller (apps/portal/view/ViewportController.mjs) must be updated to:
    • Listen for route changes.
    • On route change, call the HeadManager addon's methods to update the title, meta description, and, most importantly, the canonical URL for the new route.
tobiu assigned to @tobiu on Oct 10, 2025, 10:09 PM
tobiu added the enhancement label on Oct 10, 2025, 10:09 PM
tobiu added the ai label on Oct 10, 2025, 10:09 PM
tobiu added parent issue #7446 on Oct 10, 2025, 10:09 PM
22Yash
22Yash Oct 17, 2025, 4:36 PM

@tobiu I would like to work on this issue!

I understand this is a high-priority SEO task requiring the creation of a Main Thread Addon to dynamically manage the document content, specifically to fix the duplicate content issue by setting the canonical URL.

My plan is:

  1. Implement src/main/addon/HeadManager.mjs: Implement the setTitle, setTag (with logic to find/remove duplicates by name/property/rel), and setCanonical methods, ensuring all are accessible via RMA (Remote Method Access).
  2. Integrate in ViewportController.mjs: Implement the logic in apps/portal/view/ViewportController.mjs to listen for route changes and call the new HeadManager methods (especially setCanonical) to update the head metadata for the new route.

Please assign this to me. Thank you!

tobiu changed title from Create HeadManager Addon with Canonical URL Support to Create DocumentHead Addon with Canonical URL Support on Nov 11, 2025, 10:02 AM
tobiu
tobiu Nov 11, 2025, 10:11 AM

@22Yash sorry, missed your comment. the v11 release was insane. since this was already last month, i will tackle this one on my own.

tobiu referenced in commit 0d13b56 - "#7448 base class" on Nov 11, 2025, 10:11 AM
tobiu referenced in commit 6cd886c - "#7448 class name" on Nov 11, 2025, 10:12 AM
tobiu referenced in commit 9134cf4 - "#7448 getCanonical, getTag, setCanonical, setTag, Portal.view.ViewportController WIP" on Nov 11, 2025, 10:52 AM
tobiu referenced in commit e721456 - "#7448 Portal.view.ViewportController" on Nov 11, 2025, 11:30 AM
tobiu referenced in commit 1dc41c6 - "#7448 main.addon.DocumentHead: getLdJson, setLdJson" on Nov 11, 2025, 11:45 AM
tobiu referenced in commit d1417ee - "#7448 main.addon.DocumentHead: refactoring & cleanup" on Nov 11, 2025, 11:56 AM
tobiu referenced in commit 72c5260 - "#7448 main.addon.DocumentHead: intent driven JSDoc comments" on Nov 11, 2025, 11:59 AM
tobiu closed this issue on Nov 11, 2025, 11:59 AM