Hi,
I understand that you have trouble understanding all the rules, Zola (and most other SSGs) are quite a beast!
Zola will preserve the hierarchy of your content
folder.
So if you want to have a page at in example.com/2025/07/12/hello-world/
, you’ll have to have a file at the path content/2025/07/12/hello-world.md
.
Now, the problem is that each subdirectory is a Section in Zola, so each of your posts will be in a sub-sub-subsection of your index page. (Also, each folder must have an _index.html
for Zola to recognize it as a section).
I wrote (just for you!) a minimal template/index.html
page that hides to the visitor this Zola-internal concept of sections, by listing all pages in all sub-sub-subsections:
{% for sub in section.subsections %}
{% set sub = get_section(path=sub) %}
{% for ssub in sub.subsections %}
{% set ssub = get_section(path=ssub) %}
{% for sssub in ssub.subsections %}
{% set sssub = get_section(path=sssub) %}
{% for page in sssub.pages %}
<p>
<a href="{{ page.path }}">{{ page.date }}: {{ page.title }}</a>
</p>
{% endfor %}
{% endfor %}
{% endfor %}
{% endfor %}
Documentation for Section variables
Here’s a zip with the full minimal example: https://u.ppom.me/test.zip
An alternative is to think in Zola and put all your articles at the root of content
.
They’ll live at the root of the website to, but you can preserve existing links by adding “orphan pages” (pages in content/year/month/day/
, but without _index.html
) that just redirect to the new page location with simple html: Redirect to an external site on page load? - #3 by zolappom