Developer Docs

Blogs Connectivity & SEO Infrastructure

The Blogs Connectivity system provides automated syndication and SEO optimization for blog posts across the Ngwenya Federation. It ensures that every Malet (Outlet) has its own discoverable feed and that search engines can correctly index content across the multi-tenant architecture.

1. Automated Canonical URLs

To prevent duplicate content issues in search engines, the blogs subgraph automatically computes and persists a canonical URL for every blog post if one isn't manually provided by the Malet Owner.

Computation Logic

The BlogQueryService intercepts createOne and updateOne operations to calculate the URL using the following pattern:

https://mallnline.com/[malet-handle]/blog/[blog-slug]
  • Handle Resolution: The service uses a MaletStub to look up the unique handle associated with the maletId.
  • Fallback: If the Malet has not yet configured a handle, the system falls back to the maletId as the URL segment.
  • Manual Override: If a Malet Owner explicitly provides a value in the seo.canonicalUrl field, the automatic computation is skipped.

2. RSS Syndication

The Ngwenya Gateway proxies dynamic RSS 2.0 feeds for individual Malets, allowing Visitors to subscribe to updates via content aggregators.

Endpoint

GET /rss/m/:handle/blogs.xml

Technical Workflow

  1. The Gateway resolves the :handle to a maletId using the internal MaletStub (synced via Typegoose).
  2. It executes a high-performance GraphQL query (recentBlogs) against the blogs subgraph.
  3. The response is transformed into an XML RSS 2.0 payload with Atom namespace support.
  4. Caching: RSS feeds are bypassed by the default gateway thottle via @SkipThrottle to ensure compatibility with periodic aggregator polling.

3. Multi-Tenant XML Sitemaps

The platform generates standard XML sitemaps to assist search engine crawlers in discovering deep-linked blog content.

Sitemap Routes

Route Content
/sitemap-blogs.xml Global sitemap index listing all published blog posts across the platform.
/sitemap/m/:handle/blogs.xml Tenant-specific sitemap containing only the blog posts for a specific Malet.

Configuration Details

  • Locally Managed: Sitemaps are served directly by the gateway for maximum performance.
  • Prioritization:
    • Global blogs: 0.6 priority, monthly change frequency.
    • Per-Malet blogs: 0.7 priority, monthly change frequency.
  • Validation: Only posts with PUBLISHED status and a valid slug are included.

4. Federated Service Integration

The connectivity infrastructure relies on cross-subgraph communication patterns:

  • blogs microservice: Responsible for data persistence and the BlogQueryService lifecycle hooks.
  • ngwenya-gateway: Serves as the public-facing edge for RSS and Sitemap XML generation, aggregating data from the blogs subgraph via internal fetch requests.
  • Malet Model Stubs: Both services maintain thin stubs of the Malet entity to resolve handles and IDs without requiring full federation overhead for high-frequency SEO tasks.

5. Metadata & Open Graph

SEO meta tags are managed via the SeoService in the blogs subgraph, which provides structured data for:

  • JSON-LD: BlogPosting and Recipe schema types.
  • Open Graph: Title, description, and featured image mapping.
  • Twitter Cards: Summary Large Image format support.