Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhelpful "Section `` not found" error when building orphan pages with book theme #641

Closed
TimotheosFirestone opened this issue Mar 26, 2019 · 1 comment

Comments

@TimotheosFirestone
Copy link

Bug Report

I started building my first Zola site and I wanted to understand the content first, so I just installed the "book" theme as per these instructions so I didn't have to think about that part of it yet.

I then made some content and built the site. I had a lot of orphan pages and it seems these caused the following error:

timotheos@timotheos-latitude ~/Dropbox/timotheosfirestone $ ./zola serve
Building site...
-> Creating 19 pages (14 orphan), 2 sections, and processing 0 images
Error: Failed to render page '/home/timotheos/Dropbox/timotheosfirestone/content/cv.md'
Reason: Failed to render 'book/templates/page.html'
Reason: Section `` not found.

The documentation, however, implies that orphan pages are allowed:

markdown files within that folder will still create pages (known as orphan pages).

Step to reproduce

  • Install book theme
  • Create orphan pages
  • Build the site

Current Behavior

Issue 1

"Section `` not found" is a very unhelpful error message. It took me a while to figure out what the issue was.

Issue 2

Presumably the book theme fails to work with orphan pages?

Expected Behavior

Issue 1

Any error messages should be more detailed. It would be nice to state what line in the file caused it to fail; e.g. if it's a problem with the theme not correctly handling orphan pages or if it's something else?

It would also be good for any error to mention information about how to get more detailed error information. Only now when I am coming back to lodging this bug report does it mention in the issue template:

You can get the stacktrace of a panic by adding RUST_BACKTRACE=1 when running a zola command.

Is this relevant? I am new to Rust as well as Zola.

Issue 2

The orphan pages should have been created, as per the documentation.

@Keats
Copy link
Collaborator

Keats commented Mar 26, 2019

"Section `` not found" is a very unhelpful error message. It took me a while to figure out what the issue was.

Agreed. The issue is that it is something happening in the template engine exclusively so it is a bit hard to give more details automatically. I can however make the template error in such a case which will give the user a useful message.

The issue is that the book template relies on sections being there to handle previous/next so the theme doesn't actually work with orphan pages. I should mention that in the book theme.

I created getzola/book#12 there and will update it later this week

@Keats Keats closed this as completed Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants