# Index.html

**URL:** <https://zola.discourse.group/t/index-html/1446>\
**Category:** Uncategorized\
**Created:** [September 2, 2022, 2:09pm UTC](https://zola.discourse.group/t/index-html/1446 "2022-09-02T14:09:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jack999](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jack999](https://zola.discourse.group/u/jack999)\
**Post date:** [September 2, 2022, 2:09pm UTC](https://zola.discourse.group/t/index-html/1446/1 "2022-09-02T14:09:17Z")

</div>

Hello

I am sure I am missing something blindingly obvious.

I have built a site with zola. works fine. really like it. But I dont get the index.html in templates. I would like to make my index page the same way as all the other pages from markdown, with the toml header, which allows all the nice template macro features.

But I cannot figure our how to do the same with the main index file. It cannot have a toml header, and I cannot pass those variables to a macro template html for the header. I tried to make content/\_index.html but that did not work

so what I ended up was to make a md in contents, build, and copy that to templates/index.html, which cannot be the right way.

and for my next problem, how to get a a list of all blogs on the main index page

I am sure I am very stupid and missing the obvious,

best, j

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [September 2, 2022, 3:59pm UTC](https://zola.discourse.group/t/index-html/1446/2 "2022-09-02T15:59:18Z")

</div>

The file `content/_index.md` is the markdown for index.html

---

<div class="post-metadata">

**Author:** ![jack999](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jack999](https://zola.discourse.group/u/jack999)\
**Post date:** [September 2, 2022, 4:19pm UTC](https://zola.discourse.group/t/index-html/1446/3 "2022-09-02T16:19:41Z")

</div>

Thanks @keats !

I had tried that and put into it

```auto
+++
title = "What "
template = "index.html"
+++
text

```

and then into index.html

```auto
            {% block content %}
            {{ page.content | safe }}
            {% endblock content %}

```

and get

```auto
Reloading only template
Error: Failed to build the site
Error: Failed to render section ' /content/_index.md'
Error: Reason: Failed to render 'index.html'
Error: Reason: Variable `page.content` not found in context while rendering 'index.html'

```

so I thought I was missing something obvious, like is page in {{ page.content | safe }} incorrect? its not index.content or section.content either.

all the best, j

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [September 2, 2022, 4:40pm UTC](https://zola.discourse.group/t/index-html/1446/4 "2022-09-02T16:40:19Z")

</div>

The index is a section so you need to do `{{ section.content | safe }}`

---

<div class="post-metadata">

**Author:** ![jack999](https://avatars.discourse-cdn.com/v4/letter/j/9fc29f/32.png) [@jack999](https://zola.discourse.group/u/jack999)\
**Post date:** [September 3, 2022, 7:28pm UTC](https://zola.discourse.group/t/index-html/1446/6 "2022-09-03T19:28:21Z")

</div>

Thanks a lots @keats

it all makes sense. I now read all the docs twice and it is there. sorry for my stupidity

j
