Confusion trying to determine the page_template

Trying to mimic my WordPress setup, I still fail.

What I want to achieve is to:

  1. have a list of pages (/blog/PAGETITLE),
  2. have a list of blog articles (/blog/YEAR/MONTH/TITLE).

Of those, the blog articles should have a different template than the pages.

My current structure, including one page and one example post, is as follows:

├───content
│   │   test-page.md
│   │   _index.md
│   │
│   └───2020
│       └───08
│               test-article.md
├───sass
├───static
└───themes
    └───my-theme-name
        ├───sass
        ├───static
        ├───templates
        │       base.html
        │       comments.html
        │       index.html
        │       page.html
        │       section.html
        └───themes

According to what I read in the documentation, page.html is the template for pages and section.html is for blog posts. However, both test-page.md and test-article.md use page.html now. I tried to explicitly set section.html in content/_index.md:

+++
title = "Blog Test"
sort_by = "date"
template = "index.html"
page_template = "section.html"
+++

Yet, section.html is ignored.

I can only imagine that I am too dumb to understand the documentation. Can anyone enlighten me?

This is weird, it should be working as you expect.

Can you add a zip of that code so I can have a look at it?

I feel like I should push this. I have just tried it with the latest Zola from Git on macOS and I still fail to show the comments part in /2020/08/test.

Your {% include "comments.html" %} is outside of the content block so it is ignored.

1 Like

Ahh, too easy. That was it! :heart_eyes:
Thank you - sorry, that might make me look a bit dumb… I promise, I’m not. :wink:

This topic can be marked solved - I don’t seem to be able to do that myself.