EU Parliament Monitor — API Documentation - v0.9.24
    Preparing search index...
    • Compose a title for one SEO surface using the per-script byte budget from metadata/seo-budgets.ts. Drops the brand suffix when the article title alone fills the budget (better SERP than a truncated headline followed by a clipped brand) and falls through to a short-brand variant when that fits but the full one does not.

      Parameters

      • title: string

        Article title (plain text, already markdown-stripped)

      • lang: LanguageCode

        Target language code

      • siteTitle: string

        Full brand suffix (e.g. "EU Parliament Monitor")

      • surface: SeoSurface = 'title'

        Optional SEO surface; defaults to <title> budget

      Returns string

      Composed, budget-clamped title