Hi,
I’m building a website with pelican, where I want my index.html to display articles in different sections sorted by categories.
So for example, I have:
<div class="home-blog-list" >
<ul>
{% for article in articles if article.category == 'news' %}
<li>
<a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>, {{ article.locale_date }}</p>
</li>
{% endfor %}
</ul>
<a href="{{ SITEURL }}/category/news.html" class="section-link">More from the blog</a>
</div>
The html output that I’m previewing locally has articles filtered by the ‘News’ category as intended, but when I’m deploying the website with Netlify (using the pelican content -s publishconf.py
build command), the list appears empty. Everything else is working fine (css, js etc load correctly), and if I remove the if
statement, just keeping for article in articles
, the build returns the correct list of all articles.
Any idea what is going wrong here? Why is that specific Jinja statement working when I generate my output locally but not anymore when its through Netlify?