New Pelican capability to have hidden posts.

Thu 20 August 2026

I found that in the Bridge website I created, I have some weekly blog-type articles about Rockstar (Modern American Bridge), and I'm still writing up basic information about the conventions. I don't want the intro and overview article in the main feed (but they should still appear in the categories). Preferably, I can force the intro to the convention as the first element in a listed category.

While I'm in the codebase, I'm also going to read in the gallery: tag as an array instead of a string. This will support looking in multiple directories for webphotos and is a minimal change. The field is read, and then I split the string on a space delimiter. A single field will duck-type to a single-element array, so I can just change the processor to iterate over the array.

To make a hidden article appear in a specific category list while remaining hidden from your main index and navigation menus, you cannot use the core Status: hidden attribute alone because Pelican explicitly strips hidden posts from category indexes.

Instead, I'm going to add a custom metadata field and an update to the Jinja2 template to trigger on the new field.

In the Markdown files, instead of setting Status: hidden, set the new Hidden: field to true. No custom tag will default to false.

In the template's index.html and archives.html, the main renderer loop will now have condition code to check the Hidden value.

{% for article in articles_page.object_list %} {# Only show the article if 'hidden' metadata is NOT true #} {% if not article.hidden == 'true' %} <h2><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></h2> <p>{{ article.summary }}</p> {% endif %} {% endfor %}

This keeps the article from appearing in the regular index; the category (category.html) view will behave normally.

One final note: Pelican does support a field 'Feed: false' that prevents an article from appearing in ATOM/RSS feeds. The above code could have triggered (doubled up) on the meaning of the Feed instead of adding a new custom field, but that approach confuses the meaning of the field.

Tags: programming |