# Data and collections

Jekyll provides two main ways to create and maintain large lists/sets of items: **data** and **collections**.&#x20;

The template comes with [a few placeholder data lists for common needs](https://greene-lab.gitbook.io/lab-website-template-docs/~/changes/a57wjuxagDtJUR241kyt/basics/repo-structure#data-and-components), but if you need to create more/different ones, here's how.

{% hint style="info" %}
This page just explains how to make these lists. To actually display them on your site, use the [list component](https://greene-lab.gitbook.io/lab-website-template-docs/~/changes/a57wjuxagDtJUR241kyt/basics/components/list).
{% endhint %}

## **Data**

If you want to have a large set of structured or nested items in a single file, use a [data file](https://jekyllrb.com/docs/datafiles/).

Put a `.yaml` file in the `/_data` folder with any name, and fill it with data. The structure of the data can be arbitrary.

Example:

{% code title="/\_data/some-list.yaml" %}

```yaml
# some item
- title: Some name
  tags:
    - tag A
    - tag B
  description: Some description

# another item
...
```

{% endcode %}

## **Collections**

If you want to have a large set of items in separate files that can also generate their own separate pages on your site, use [collections](https://jekyllrb.com/docs/collections).&#x20;

Put `.md` files in a folder prefixed with a `_`, and fill their [front matters](https://greene-lab.gitbook.io/lab-website-template-docs/~/changes/a57wjuxagDtJUR241kyt/basics/edit-pages#edit-page-details) with data. To generate a separate page for each item in the collection, set `output: true` in your config file [as described here](https://jekyllrb.com/docs/collections).

Example:

{% code title="/\_some-list/some-file.md" %}

```markdown
---
title: Some name
tags:
  - tag A
  - tag B
description: Some description
---

Some Markdown content
```

{% endcode %}

{% code title="/\_some-list/another-file.md" %}

```markdown
---
title: Another name
---

Some Markdown content
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://greene-lab.gitbook.io/lab-website-template-docs/~/changes/a57wjuxagDtJUR241kyt/advanced/data-and-collections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
