Sections that are part of the page are listed in the main file (typically
index.html).
They should not be written to disk.
This can be done by setting the :save_as: attribute to an empty value.
That is, in your metadata, you should have:
The only page that should have a value for save_as is the index page.
So, for example, we have the following files in content/pages, with values
for save_as as shown:
abfaelle.asciidoc::save_as:
altlasten.asciidoc::save_as:
arbeitssicherheit.asciidoc::save_as:
index.asciidoc::save_as: index.html
naturschutz.asciidoc::save_as:
sanierung.asciidoc::save_as:
about.asciidoc::save_as:
Don’t set :save_as: to False or the empty string ('').
Then two bad things may happen:
For a value like False, there is still a file written to the output directory.
It’s called, you guessed right, False.
And then, as most probably more than one page is converted to False, Pelican
complains that a filename occurs twice, something it does not allow.
So, just keep :save_as: empty.
Don’t know why it works, the docs say nothing about it, but it works.
You could come up with the idea to just use :status: skip for pages that
should not be written, a new feature that i describe
here: https://drnik.org/dont-write-pages-to-disk-in-pelican.html
But that does not work.
Skipped pages are not accessible in templates, as they are not part of the
pages list that is passed to templates.
I tried to implement a variable called skipped_pages that is passed to
templates, analoguos to the hidden_pages and draft_pages that are available
in templates, but it didn’t work.
I could not make skipped_pages appear in templates.