3
votes

I am creating a Jekyll theme where all user pages that implement the 'indexable' attribute in the front matter are rendered in the main landing page. So I have the 'frontpage layout:

---
layout: root
---

{% assign custom_pages = site.pages | where: 'indexable', true | sort: 'priority' | reverse %}

{% include header.html %}

{% for c_page in custom_pages %}
<div class="container {{ c_page.class | default: '' }}" >
    {{ c_page.content }}
</div>
{% endfor %}


{% include footer.html %}
{% include javascripts.html %}

A sample page that will be processed:

---
layout: page
title: Us
permalink: /us/
indexable: true
priority: 10
class: us-page
---

<div class="row">
    {% for member in site.data.members %}
    <div class="col-sm-6">
        <div class="card card-block">
            <img src="{{ member.gravatar }}?s=256" alt="Avatar">
            <h4 class="card-title text-xs-center">{{ member.name }}</h4>
            <p class="card-text">{{ member.description | markdownify }}</p>
            <p class="card-text">
                {% for tag in member.expertise_areas %}
                    <span>{{ tag }}</span>
                {% endfor %}
            </p>
            <a href="{{ member.blog }}" class="btn btn-primary" role="button" >Mi blog</a>
        </div>
    </div>
    {% endfor %}
</div>

However the liquid tags are appearing unprocessed, like the same output {% raw %} would produce. Is there a way through I could do {{ c_page.content | magic_here }} in order to manually get rendered those tags?

EDIT. Screenshot: enter image description here

EDIT2

1
You can markdownify, but you can't liquidify. Your problem is elsewhere but without complete code, it's hard to spot it. Any code repository ?David Jacquel
@DavidJacquel Yes, although set up an environment might be tedious right now. I have two repos, one for the theme, an another for the web implementation. In the later I have added the gem locally. I am editing the question to link to both anyway.sonirico

1 Answers

3
votes

Well, despite I still don't know whether the issue is in my code, I am posting how I managed to solve it. Basically I created a filter tag called liquefy which has been put in a .gem and whose main task is taking a text with markdown or/and liquid syntax as an argument which will be parsed and rendered.