Content adapters: Creating multi-level subpages

Hello,
I want to create a similar structure
docs/test/
_content.gotmpl
_index.md
2024/
_index.md
January/
_index.md
February/
_index.md

2025/
_index.md
January/
_index.md

_content.gotmpl


{{ range $uniqueYears }}
  {{ $currentYear := . }}
    ....
    {{ $yearPageDict := dict
      "content" $yearContentDict
      "kind" "section"
      "params" $yearParamsDict
      "path" $yearPagePath
      "title" (printf "%s" $currentYear)
    }}
    {{ $.AddPage $yearPageDict }}

    {{ range $uniqueMonths }}
      {{ $currentMonth := . }}
        ...
        {{ $monthPageDict := dict
          "content" $monthContentDict
          "kind" "page"
          "params" $monthParamsDict
          "path" $monthPagePath
          "title" $monthName
        }}
        {{ $.AddPage $monthPageDict }}
  {{ end }}
{{ end }}

If you look at the links
docs/test/test3/2024/_index.md/
docs/test/test3/2024/07/_index.md/
docs/test/test3/2024/06/_index.md/ the path is indicated there, but visually it looks wrong. There is no nested system. I expect that when I click on the year, the months will be visible. And now I see the month on the same level as the year. I see this error only if I create pages through gotmpl

image

I’m not sure what that means, but this sounds like a CSS issue or a question for the theme’s author.

I’ve updated my post with more details. Strangely, this happens only if I create md files through a gotmpl file

All these hava a trailing slash ?

Please keep in mind that from source to visual a lot of components are involved. So a stripped down version of the adapter won`t be enough.

Also you omitted the complete path calculation…

Also the theme is important

You might get better assistance if you share your code

Hi, Thank you for the questions and advice
All these have a trailing slash? -Yes, they all have a trailing slash

A slash after the file extension? Sound weird
So compare the

  • filename of a working non adapter source file
  • with your calculated filename in the adapter