EU Parliament Monitor - API Documentation - v0.8.1
    Preparing search index...

    Function enrichMetadataFromContent

    • Enrich article metadata by analysing the rendered article content.

      This function is the main entry point — called by the generation pipeline after buildContent produces the article HTML body but before the HTML is wrapped in the full page template.

      It refines the strategy-provided base metadata with content-derived insights so that titles, descriptions, and keywords reflect the actual article coverage rather than generic template text.

      Parameters

      • content: string

        Rendered article HTML body (from strategy.buildContent)

      • baseMetadata: ArticleMetadata

        Base metadata from strategy.getMetadata

      Returns ArticleMetadata

      Enriched metadata with content-aware title, description, and keywords