Static landing page using non-index template

This question has certainly an obvious answer but I can’t find it. How to get a static page in the root of the site using a non-index template?

Now I have a home.md file in the content folder using the landing.html template, which inherits from index.html and I can see my site at /home.

If I rename home.md to index.md (still having the same template in the front matter), looking at / gives me the page rendered with the index.html template. WTF’s happening? Expected behavior would be to use the landing.html template, wouldn’t be?

As a workaround I added a redirection in my {% block content %} as follows :
<script>document.location.href="/home/"</script>

Index pages are _index.md, with a leading underscore. If template is specified though it should use it.

1 Like

Thanks for the answer! I think I was stuck because I wanted to create a page and not a section. I still do not really get the difference between the two. I’m pretty sure I already tried this option but may not have understood the error message saying Reason: Variable `page.extra` not found in context while rendering 'landing.html'. It was actually looking for a section variable, not a page one.

I’m coming from pelican and I am not familiar with this concept. Thanks a lot for this very good piece of software, I’ll maybe write a “dumb-beginner’s tutorial” for people like me who are not good enough at reading the doc :slight_smile:

I’ll maybe write a “dumb-beginner’s tutorial” for people like me who are not good enough at reading the doc

The docs are definitely missing a quickstart: https://github.com/getzola/zola/issues/534
Any help on that is welcome!

1 Like

@keats j’ai fait un prototype de quickstart en français, tu peux me faire des retours et quand ça te convient, je traduirai en anglais : https://git.42l.fr/HugoTrentesaux/zola-quickstart