How get rendered post in home index page?

Hi,

I’m trying to have my main landing page show the first 3 posts fully rendered.

I tried using {{ post.content }} and {{ post }} but both just give the raw content, not the rendered content.

How does one apply the proper rendering based on what the format is ? i.e. I have a mix of md and adoc files so I can’t just apply i.e. asciidocify or markdownify.

Thanks!

You can get the extension of the file and apply the right converter.

Yes but is there really no way to just call transform or similar so I don’t have to repeat the logic Jekyll already should have somewhere?

for now doing the following:

contentify.liquid:

{% assign splitted = include.path | split: "." %}
{% assign postfix = splitted.last %} 
{% if postfix == 'adoc' %}
     {{ include.content | asciidocify }}
{% else %}
    {{ include.content | markdownify }}
{% endif %}

then when I need content rendered I do this:

 {% include contentify.liquid path=post.path content=post.content %}

kinda crazy for me that my templates need to know how to convert content - but at least I can move forward for now.

well that didn’t work…gets different behavior when running with or without --incremental ;/

opened bug at https://github.com/jekyll/jekyll/issues/7433