Links with miniatures based on tags in Pelican

7 Views Asked by At

I'm writing a website in Pelican. I have pages with metadata Projects. I want to display them as a list of links to the specific projects (which are in fact "articles" in Pelican terms).

---
Title: Flowers
# featured projects
Projects: 
  - tulips
---
{% if page.projects %}
        <h2>Featured Projects:</h2>
        <ul>
            {% for title in page.projects %}
                {% set article = articles | selectattr('title', 'equalto', title) | first %}
                {% if article %}
                    <li><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></li>
                {% endif %}
            {% endfor %}
        </ul>
    {% endif %}
    

This all works fine and lists the links correctly. Now I would like each link to be a thumbnail with a specific background and the project's name in the middle. Like this:

enter image description here

Is there a way to add the information about thumbnails to the configuration somewhere, so that Pelican knows which background image to add as a thumbnail of each project?

0

There are 0 best solutions below