# How to paginate Data File

**URL:** <https://talk.jekyllrb.com/t/how-to-paginate-data-file/6711>\
**Category:** Help\
**Created:** [November 19, 2021, 4:42pm UTC](https://talk.jekyllrb.com/t/how-to-paginate-data-file/6711 "2021-11-19T16:42:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dancat93](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/dancat93/32/3975_2.png) [@dancat93](https://talk.jekyllrb.com/u/dancat93)\
**Post date:** [November 19, 2021, 4:42pm UTC](https://talk.jekyllrb.com/t/how-to-paginate-data-file/6711/1 "2021-11-19T16:42:46Z")

</div>

Hi everyone, there’s a way to paginate the files inside the \_data folder?  
Because I used an API cms (Strapi) and I created a plugin that generate for each API’s call a JSON file. Basically I used these json files inside for cycle in the code.

So I want to paginate the records inside this files

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [November 19, 2021, 7:30pm UTC](https://talk.jekyllrb.com/t/how-to-paginate-data-file/6711/2 "2021-11-19T19:30:52Z")

</div>

not that I know of. The way you get info out of a data file is to call it while on a page - but that page cannot be paginated. And there is no concept of creating pages from data.

You could make a plugin to do it I think - I think I have seen an example where someone had products in a data file and wanted a page for each product.

You may be able to do it with pure JS?

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [November 20, 2021, 6:26pm UTC](https://talk.jekyllrb.com/t/how-to-paginate-data-file/6711/3 "2021-11-20T18:26:30Z")

</div>

In what sense do you want to paginate? In the JSON files, in Jekyll rendering the JSON, in getting the JSON on the frontend with JS?

> So I want to paginate the records inside this files

Can you provide a sample of what this looks like? Such as if you have 1000 rows in your JSON file and you want 5 files of 200 rows each? That can be achieved from the shell with Python, Node, Ruby, etc. Or Ruby if you want a plugin to do it for you.

* * *

If you have say 3 API calls, you’ll get 3 JSON files in `_data`, by the sound of how your plugin works.

Are those identical calls for multiple pages, or 3 different endpoints?
