EU Parliament Monitor — API Documentation - v0.9.24
    Preparing search index...

    Module Generators/NewsIndexes

    Generates index.html files for each language listing all news articles. English is the primary homepage (index.html); other languages use index-{lang}.html. Design follows riksdagsmonitor patterns: compact language switcher, Hack23 AB footer.

    Refactor 8/8 split the original 959-LOC monolith into three modules:

    • ./news-indexes/per-language.js — pure HTML composer (generateIndexHTML, getIndexFilename) — no file I/O.
    • ./news-indexes/backfill.js — legacy SEO/hreflang/JSON-LD healing (backfillLegacyArticleSeo, healJsonLdDescriptionCorruption, backfillArticleHreflang, applyArticleSeoBackfill, buildLegacyBackfillDescription).
    • This file — top-level main() orchestration: discovery, metadata-map construction, database write, per-language atomic write.

    All previously-public exports are re-exported here so existing callers and the regression test suites in test/unit/news-indexes-*.test.js keep working unchanged.

    Functions

    generateIndexHTML → generateIndexHTML
    getIndexFilename → getIndexFilename
    backfillLegacyArticleSeo → backfillLegacyArticleSeo
    backfillArticleHreflang → backfillArticleHreflang
    healJsonLdDescriptionCorruption → healJsonLdDescriptionCorruption
    applyArticleSeoBackfill → applyArticleSeoBackfill
    buildLegacyBackfillDescription → buildLegacyBackfillDescription