Skip to content

Excluding Content Output

Posted on: Feb 15, 2021 by Stephanie Eckles
🍿 1 min. read

Explore scenarios where you may want to exclude content from output or collections.

Prevent Page Generation Output

Sometimes you may want to create content using your preferred templating language but not actually output an individual page.

The preferred way to do this is via permalink:

permalink: false

If you want this to apply to an entire collection, you can do this in a directory data file. This example is used for this very site to create the resource content on the home page:

{
"tags": "resources",
"permalink": false
}

Read more about setting permalink to false in the official docs

Excluding Content From Collections

Within a directory intended to be content for a collection, you may have content, such as the index, that you do not want included in the collection itself.

To entirely exclude the content from any collection, set eleventyExcludeFromCollections to true:

eleventyExcludeFromCollections: true
View more quick tips