[solved] Hidden posts

A followup for the history sake: I ended up putting “hidden” pages inside /content/hidden and creating /templates/feed.xml with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}">
	<title>{{ config.title }}
		{%- if term %} - {{ term.name }}
		{%- endif -%}
	</title>
	{%- if config.description %}
	<subtitle>{{ config.description }}</subtitle>
	{%- endif %}
	<link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/>
	<link href="{{ config.base_url | safe }}"/>
	<generator uri="https://www.getzola.org/">Zola</generator>
	<updated>{{ last_updated | date(format="%+") }}</updated>
	<id>{{ feed_url | safe }}</id>
	{%- for page in pages %}
        {%- if page.components is not containing("hidden") %}
        <entry xml:lang="{{ page.lang }}">
            <title>{{ page.title }}</title>
            <published>{{ page.date | date(format="%+") }}</published>
            <updated>{{ page.updated | default(value=page.date) | date(format="%+") }}</updated>
            <link href="{{ page.permalink | safe }}" type="text/html"/>
            <id>{{ page.permalink | safe }}</id>
            <content type="html">{{ page.content }}</content>
        </entry>
        {%- endif %}
	{%- endfor %}
</feed>

The benefit here is that you don’t have to remember to put something in a page header, just keep it in the corresponding folder.

Thanks for you help again, @keats! You are doing such an amazing job here!

3 Likes