Jekyll - Plugins don't work when sorting posts

I have a plugin called jekyll-spaceship in Jekyll - It helps me to use video feature (not available in Markdown): ! [Video] (https:// vimeo. com/633912445?height=500)

Everything works perfectly on post page.

But in home page, I am listing posts like this:

<div id="main" class="site-main">                                                          
  <div id="primary" class="content-area">
    <div id="content" class="site-content" role="main">
      {% for post in paginator.posts %}
      <header class="entry-header">
        <h1 class="entry-title">
          <a href="{{post.url}}" rel="bookmark">{{post.title}}</a>
        </h1>
      </header>
      <div class="entry-content">{{ post.content }}</div>
      {% endfor %}
    </div></div>
</div>

And, this event turns it into an image. So I can’t use the plugin feature. I think {% for post in paginator.posts %} turns it into normal Markdown.

How can I fix this problem?

By the way, I am using jekyll-paginate-v2 for paginating but doesn’t matter, its the same like normal Jekyll

If the result of {{ post.content }} is un-rendered raw Markdown, then you could feed it through the markdownify filter. I.e. {{ post.content | markdownify }}.

1 Like

I tried this but same. It’s returning same thing. Only in {{post}} its returning well. I thought I can define something like

{% if post.layout == “post” %}
{% assign post.layout == “none” %}
{{ post }}
{% endif %}

But it’s not working. (assign is not working)

I am not familiar with that plugin, but you could do this with a little liquid include tag. I know you lose the markdown option, but it might be a better solution for you? Here is a good GitHub resource that will walk you through the easy steps to make it work. No need to download the repo; check out the readme file.

The basic idea is to add a file called vimeo-player.html in the root _includes folder of your Jekyll site (create the folder if necessary).

Then, inside the vimeo-player.html file, you set up the code, like this:

<div class="embed-container">
  <iframe
      src="https://player.vimeo.com/video/{{ include.id }}"
      width="889"
      height="500"
      frameborder="0"
      webkitallowfullscreen
      mozallowfullscreen
      allowfullscreen>
  </iframe>
</div>

Then, in your post, you can still type markdown, but wherever you want the video, type something like this:

{% include vimeo-player.html id=633912445 %}

I did not test this, but believe the video will display on the blog roll on your home page using this method.

1 Like