Elements not rendered

Hi there, I am new to github and jekyll. I have 0 knowledge about liquid. Here is my problem. I created a folder named karakter.

├─ _posts
├─ karakter
   └─ kindex.html
   └─ dengmul.md
   └─ hasima.md

here is kindex.html

layout: default
title: karakter
permalink: /karakter/

<div class="row test">
<h1>{{ page.title }}</h1>
{% for post in site.karakter[page.karakter] %}
  <li><a href="{{ post.url }}">{{ post.title }}</a> ({{ post.date | date_to_string }})</li>
{% endfor %}

and here is dengmul.md:

layout: post
title: dengmul
date: 2022-08-13
karakter: dengmul

some text

The result is blank. All I want is an output like this when accessing www.mysite/karakter/:

- dengmul - date
- hasima - date

Thanks in advance

I don’t think that is a thing - you can loop over posts, collections or pages. From what I can tell dengmul is just a page - as is kindex and hasima. They don’t look to be part of a collection or posts, that leaves them as pages.

You could put dengmul into the _posts folder and name it with the date and then the title (posts have to have the date in the name, see the docs) and then you should be able to do your loop using site.posts instead of site.karakter[page.karakter].

Or look into using collections, main difference is collections don’t have to have the date in the file name.

I see. Putting them inside _posts folder will cause another problem :slight_smile: so I will try collections instead.

Thanks @rdyar