Creating pages

Extra data

You can assign extra data to your site available everywhere. This allows to have functions that you can execute everywhere, for example for searching or pagination results.

In fact, there are two helpers available by default: search and paginate precisely for that purpose.

If you need to add more extra data, use the _config.js file:

site.data("randomNumber", function () {
  return Math.random();
});

Now, this function is available in your layouts:

<p>Random number: {{ randomNumber() }}</p>