fix(references): merge per-chapter bibliographies into one list
#3
by AdithyaSK HF Staff - opened
Each chapter is its own MDX file, so rehype-citation builds one bibliography per chapter. The footer script then moved all of them to the end as separately numbered lists, and a source cited in two chapters appeared twice.
This merges them into a single list in the footer:
- one entry per source (matched by entry id);
- sorted by author, as APA expects;
- the "back" links of duplicate entries combined, so every citation still links back to where it was used.
Articles with a single chapter, or a single reference list, are untouched.
Tested on the demo article and on a six-chapter article (24 sources, previously split across several lists).
Same change on GitHub: https://github.com/tfrere/research-article-template/pull/1