Unwanted Pages From Markdown Used In Collections

I read the eleventy tutorial last summer (it was great) and built a site with the same basic structure. For services that this company offers, which I wanted to list multiple places, I used the technique from the tutorial for adding team members to the About page via the “people” collection.

Now I’ve added a sitemap and noticed that eleventy is generating blank pages for each of these markdown files. I looked at my site from the tutorial and see the same thing. There’s a /people/ directory with nothing but more directories with blank HTML files.

I can’t add them to the .eleventyignore file, because then they don’t show up in the collections.

So how do I use markdown files for portions of the site without giving them each their own page?

Ah I think what you need is permalink: false. Info here.

This stops a piece of content generating an output page. I thought I had set the course starter files to do that, but I’ll check again.

If you have all the items in a directory like people, you can add a file in that directory called people.json and in there, do this:

{
   "permalink": false
}

That’ll apply to all current and future files in that directory then.

Thanks, that’s just what I needed to know.

Interestingly, the JSON file solution is causing template rendering errors with pageUrl.indexOf is not a function in the getLinkActiveState helper function. If I add permalink: false to the frontmatter of each file, it’s fine.

1 Like