Skip to content

Research library ​

The /biblioteca route publishes the long documents the team writes in research/**/*.md and outputs/briefings/*.md. Until this surface, those files lived only in the repository. On the site anyone can filter them, read them and cite them.

It is distinct from /investigacion. That route serves country × axis papers on score levers. This one serves program reports (sector angles, country dossiers, briefings).

What the reader sees ​

On the list (/biblioteca):

  • search by title, summary and tag
  • filter by type (sector, pais, par, instrumento, metodo, territorio, riesgo, briefing)
  • filter by the 25 LAC countries
  • sort by date or by number of sources
  • each card shows title, type, date, summary and three rigor signals: words, sources (distinct URLs) and DOIs
  • badges when the text contains ## Anexo de verificación, ## Revisión de pares or Qué falsaría

On the detail page (/biblioteca/$slug):

  • full markdown, with the same renderer the chat uses (ChatMarkdown: GFM tables, lists, links)
  • section index
  • link to the source on GitHub (futurosxyz/futuros)
  • PDF download (/research/pdf/<slug>.pdf): the same document typeset as an academic paper — title page with series, abstract and keywords, numbered sections, captioned tables, a hanging-indent bibliography, running head and folio. All 62 PDFs are versioned in public/research/pdf/ (37 MB total, compressed); they are not bake output and are regenerated by the typesetting pipeline.
  • suggested citation block

Document text stays in the language it was written in. What is translated (ES/EN/PT) is the interface.

How the index is generated ​

It is not edited by hand. scripts/bake-research-library.ts walks the folders (if one does not exist yet, it skips it) and writes:

OutputContents
public/data/research-library.jsonindex: slug, path, title, date, type, summary, metrics, countries, tags
public/research/<slug>.jsonthe same plus the full markdown

The slug is the filename without the leading date or the extension. The title comes from frontmatter title:, or from the first # if that is missing. The summary is the first prose paragraph (not a heading), clipped to ~320 characters without cutting words. Countries are detected with the canonical list in src/data/geographies.ts plus iso3/country in the frontmatter.

The script runs in prebuild:fast, prebuild:full and scripts/bake-all.ts. The JSON files are bake artifacts: they are in .gitignore. The source of truth is the markdown. A build without the script leaves /biblioteca empty; that is why prebuild always runs it, including on Vercel previews (the bake uses no network).

Locally, before bun run dev:

bash
bun run bake:research-library

What it does not touch ​

It does not write public/investigacion/index.json or public/investigacion/coverage.json. Those files belong to the country × axis paper wave.

Every figure with its source — traceability is the contract.