Trying to get a collection from a Front Matter value

Hi I’m new to Jekyll and have a basic blog set up. Now my idea is to loop through a collection per blog post to get some fancy HTML going on. Because as far as I’m aware you can’t simply add HTML to the markdown.

// config.yml

  - hollowknight

So I’ve set up a collection named hollowknight and I got a blog post about Hollow Knight.
In the Front Matter of the blog post I have collectionid: 'hollowknight'. And in the Layout I use for blog posts I tried the following:

// post.html

{% capture collection %}site.{{ page.collectionid }}{% endcapture %}

{% for section in collection %}
  {{ section.title }}
{% endfor %}

So the idea was to set the collection variable to site.hollowknight as configured in the config and the Front Matter. I set up a single article inside the collection, but it isn’t showing up.

Is there any way to realise this?

Or is there a way to use paragraphs in the Front Matter, because then I could just use arrays and objects in the Front Matter of the posts to do my magic?

Or am I just stretching to far from what Jekyll is supposed to be?

So it would be possbible with Front Matter arrays and objects:

    - title: section 01
      videoid: 193641463
      content:  |
        # Lorem Ipsum  
        is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.

        # It has survived
        not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

But can’t get | textilize to work.


So I found out I was getting the collection the wrong way, List collection with name from front matter.

{% for section in site.[page.collectionid] %}
  {{ section.content | textilize }}
{% endfor %}

The only weird part is, everywhere I see | textilize being used but can’t get it to work.

Only a comment to this:

You can add HTML code to markdown. Occasionally it might be necessary to add
just before the closing angle bracket.

Thanks michaelbach.

Any clue where the textilize filter comes from or why it isn’t working.
Can’t find anything about it in the Liquid documentation or Jekyll documentation.

Is it possible to use Markdown in Front Matter and then convert it to HTML?

Closing this topic since I have found several solutions (See edits in original post).
Am now coping with a new challange called Markdown to HTML.