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 paresorQué 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 inpublic/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:
| Output | Contents |
|---|---|
public/data/research-library.json | index: slug, path, title, date, type, summary, metrics, countries, tags |
public/research/<slug>.json | the 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:
bun run bake:research-libraryWhat 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.