11ty / eleventy

A simpler site generator. Transforms a directory of templates (of varying types) into HTML.
https://www.11ty.dev/
MIT License
17.29k stars 496 forks source link

Bug: If no layout is specified, 11ty tries to find an `_includes/page.njk` #3529

Open LeaVerou opened 3 weeks ago

LeaVerou commented 3 weeks ago

I just started a new 11ty product and unlike most times I specified NO layout anywhere, since this is a SPA. Not in my front matter, not in my 11ty config. To my surprise I got an error:

Error: You’re trying to use a layout that does not exist: _includes/page.njk (via layout: page.njk)

I would have expected that if no layout is specified, none is used, and it just spits out the result of processing my template as-is.

Ryuno-Ki commented 3 weeks ago

Would https://www.11ty.dev/docs/languages/#use-nothing-(no-transformations) work for you?

LeaVerou commented 3 weeks ago

layout: null works fine, I wasn’t looking for a workaround. Thanks though!