4. Global data files

Nam

Nam Hoang / Sep 24, 2021

1 min read

Global data files

Your global data folder is controlled by the dir.data configuration option. All _.json and module.exports values from _.js files in this directory will be added into a global data object available to all templates.

Paginate a global

For example, consider the following globalDataSet.json file in your global data directory.

{
  "myData": [
    "item1",
    "item2",
    "item3",
    "item4"
  ]
}

Your front matter would look like this:

---
pagination:
  data: globalDataSet.myData
  size: 1
---

<ol></ol>