lumeland / lume

🔥 Static site generator for Deno 🦕
https://lume.land
MIT License
1.88k stars 86 forks source link

Error loading layout files #666

Closed smcjustin closed 3 weeks ago

smcjustin commented 3 weeks ago

Version

v2.3.2

Platform

MacOS Sequoia 15.0

What steps will reproduce the bug?

  1. Install Deno v1.46.3 and Lume v2.3.2, Lume CMS v0.6.3
  2. In the /src folder create a index.md file. In the front matter add layout: layouts/base.vto
  3. Create the folder _includes/layouts and add the file base.vto with boilerplate html
  4. Run lume serve

How often does it reproduce? Is there a required condition?

Every time.

What is the expected behavior?

Lume should create the file index.html in the _src directory using the base.vto template.

What do you see instead?

Lume throws an error: The layout file "/_includes/layouts/base.vto" doesn't exist

Here is the full output:

error: Uncaught (in worker "") (in promise) Error: Error rendering the layout of the page /index.md
            throw new Error(
                  ^
    at https://deno.land/x/lume@v2.3.2/core/renderer.ts:176:19
    at eventLoopTick (ext:core/01_core.js:175:7)
Caused by: Error: The layout file "/_includes/layouts/base.vto" doesn't exist
    at Renderer.#renderLayout (https://deno.land/x/lume@v2.3.2/core/renderer.ts:279:15)
    at https://deno.land/x/lume@v2.3.2/core/renderer.ts:159:52
    at concurrent (https://deno.land/x/lume@v2.3.2/core/utils/concurrent.ts:10:33)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async Renderer.renderPages (https://deno.land/x/lume@v2.3.2/core/renderer.ts:155:7)
    at async Site.#buildPages (https://deno.land/x/lume@v2.3.2/core/site.ts:641:5)
    at async Site.build (https://deno.land/x/lume@v2.3.2/core/site.ts:541:9)
    at async buildSite (https://deno.land/x/lume@v2.3.2/cli/utils.ts:48:3)
    at async onmessage (https://deno.land/x/lume@v2.3.2/cli/build_worker.ts:23:16)
error: Uncaught (in promise) Error: Unhandled error in child worker.
    at Worker.#pollControl (ext:runtime/11_workers.js:204:19)
    at eventLoopTick (ext:core/01_core.js:175:7)

Additional information

No response

oscarotero commented 3 weeks ago

Is the _includes folder inside the src folder?

smcjustin commented 3 weeks ago

Sorry, that was the issue.

It would be helpful to update this line in Getting Started > Create a Layout to be more clear:

Create a new directory _includes and the file layout.vto inside it.

To:

Create a new directory _includes inside the src directory. Create the file layout.vto inside it.