# What is the structure of \`site\` data

**URL:** <https://talk.jekyllrb.com/t/what-is-the-structure-of-site-data/8140>\
**Category:** Help\
**Created:** [April 5, 2023, 12:02pm UTC](https://talk.jekyllrb.com/t/what-is-the-structure-of-site-data/8140 "2023-04-05T12:02:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Infominer](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/infominer/32/2905_2.png) [@Infominer](https://talk.jekyllrb.com/u/Infominer)\
**Post date:** [April 5, 2023, 12:02pm UTC](https://talk.jekyllrb.com/t/what-is-the-structure-of-site-data/8140/1 "2023-04-05T12:02:37Z")

</div>

If I understood this structure of site.data how all of the data is arranged, depending on its source (importantly `_data`, `_posts`, and the tags… how to reference a given post then I can probably solve my own problem here:

> [@Adding to site.tags from csv \_data](https://talk.jekyllrb.com/t/adding-to-site-tags-from-csv-data/8138):
>
> I have a number of posts, which I’m now building from a data file. Depending on the post, my template reads the data, and displays the content as expressed by the liquid templating. Additionally, I have modified archive-single.html so that it displays both frontmatter tags along with the tags in my datafile. now, for the final frontier, I want add, from my data file, to site.tags, so that on tags.html I can click the given tag and find which posts belong to it any direction would be super, t…

I’m trying to `{{ site.data | inspect }}` but… hahah… that just freezes my build.

maybe I’ll try again with a blank template, and see if I can get it to work.

Thanks.

---

<div class="post-metadata">

**Author:** ![Infominer](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/infominer/32/2905_2.png) [@Infominer](https://talk.jekyllrb.com/u/Infominer)\
**Post date:** [April 5, 2023, 2:02pm UTC](https://talk.jekyllrb.com/t/what-is-the-structure-of-site-data/8140/2 "2023-04-05T14:02:28Z")

</div>

I found how to generate some of the answers myself:

```auto
---
title: "site data"
permalink: /tagz/
layout: single
---

## _site

<!--NOT WORKING -->
<ul>
{% for item in site %}
  <li>
      {{ item[0] }}
  </li>
{% endfor %}
</ul>

<!-- WORKING-->
### _site/data
<ul>
{% for item in site.data %}
  <li>
      {{ item[0] }}
  </li>
{% endfor %}
</ul>

```

and this plugin seems will provide the win:

> **[GitHub - MichaelCurrin/jekyll-keys-filter: A light copy-and-paste Jekyll...](https://github.com/MichaelCurrin/jekyll-keys-filter)**
>
> A light copy-and-paste Jekyll plugin to get keys from a hash - GitHub - MichaelCurrin/jekyll-keys-filter: A light copy-and-paste Jekyll plugin to get keys from a hash

---

<div class="post-metadata">

**Author:** ![Infominer](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/infominer/32/2905_2.png) [@Infominer](https://talk.jekyllrb.com/u/Infominer)\
**Post date:** [April 7, 2023, 7:57pm UTC](https://talk.jekyllrb.com/t/what-is-the-structure-of-site-data/8140/3 "2023-04-07T19:57:49Z")

</div>

Following are the top level headings falling under `site`, and below that the code I used to find that (along with code for exposing `site.data` and `site.posts` headings. you should be able to determine the rest of whatever you are looking for, from here.

## top level `site.{{variable}}`

time, documents, related\_posts, config, data, pages, tags, posts, static\_files, categories, collections, html\_pages, source, destination, collections\_dir, plugins\_dir, layouts\_dir, data\_dir, includes\_dir, safe, include, exclude, keep\_files, encoding, markdown\_ext, strict\_front\_matter, show\_drafts, limit\_posts, future, unpublished, whitelist, plugins, markdown, highlighter, lsi, excerpt\_separator, incremental, detach, port, host, baseurl, show\_dir\_listing, permalink, paginate\_path, timezone, quiet, verbose, defaults, liquid, rdiscount, redcarpet, kramdown, jailed, theme, minimal\_mistakes\_skin, locale, title, title\_separator, name, description, url, repository, github, teaser, logo, masthead\_title, words\_per\_minute, comments, staticman, reCaptcha, atom\_feed, search, search\_provider, algolia, google, google\_site\_verification, bing\_site\_verification, yandex\_site\_verification, naver\_site\_verification, twitter, facebook, og\_image, social, analytics, author, footer, sass, paginate, jekyll-mentions, category\_archive, tag\_archive, compress\_html, livereload\_port, serving, watch, gist

### Code

The folowing code exposes the names of top level items in `site`, `site.posts`, and `site.data`

```auto
---
title: "site data"
permalink: /data/
layout: archive
---

## _site
<ul>
{% for item in site %}
  <li>
      {{ item[0] | inspect }}
  </li>
{% endfor %}
</ul>

## _site/_posts
<ul>
{% for item in site.posts %}
  <li>
      {{ item.first }}
  </li>
{% endfor %}
</ul>

### _site/data
<ul>
{% for item in site.data %}
  <li>
      {{ item[0] }}
  </li>
{% endfor %}
</ul>

```
