getzola / zola

A fast static site generator in a single binary with everything built-in. https://www.getzola.org
https://www.getzola.org
MIT License
13.12k stars 924 forks source link

0.18.0 `zola serve` requires restart to complete Getting Started Overview #2441

Closed iamorphen closed 2 weeks ago

iamorphen commented 5 months ago

Documentation issue

(Thanks for Zola!)

Summary

I am new to Zola and started by following the Getting Started Overview documentation. When following the current docs top-down as-is, I get a 404 when attempting to follow the instructions here:

If you go to http://127.0.0.1:1111/blog/, you will see the section page for blog. The list is empty because we don't have any blog posts. Let's fix that now.

I need to kill zola serve and restart it, and then the page resolves.

Runtime: macOS 14.1.1, Zola 0.18.0, Firefox 121.0.1.

Proposed solution

At the time of this writing, the hosted docs say they're for Zola 0.17.*, so maybe my experience is a known or expected issue. However, I don't see any advisories in the docs on master either. Possible solutions are updating the docs to mention that we might need to restart zola serve or making the zola tool robust to whatever underlying changes it needs to monitor for the docs to work as-is.

pranaysy commented 5 months ago

I am experiencing the exact same issue with Zola 0.18.0 on Windows 10 22H2 running Firefox 122.0.1. I can confirm that killing zola serve and restarting fixes the issue.

ulab commented 3 months ago

I do think that the order in which pages and templates are created is wrong. The introduction creates the content first, then the template file. So you get:

Error: Failed to build the site
Error: Failed to render section '.../content/blog/_index.md'
Error: Reason: Tried to render `blog.html` but the template wasn't found

While creating the template then is recognized, it only reloads the template, not the content.

Change detected @ 2024-04-29 16:39:14
-> Template changed .../templates/blog-page.html
Reloading only template
Done in 2ms.

If you create the templates first and then the content, it will work without restarting.

Flynt-251 commented 2 weeks ago

Had the same issue with Zola 0.17.2* on Windows 11 23H2 running Firefox 128.0, the whole blog section would not load and gave a 404 until I tried @ulab's fix above.

For anyone else who's struggling to get through the tutorial, try creating all the templates first, then create the sections and pages under the content directory.

*I installed Zola with winget, so this must be the version it pulled, which feels a bit odd if the tutorial is meant for 0.17.X

Keats commented 2 weeks ago

We should probably rewrite the getting started page to avoid those issues, anyone wants to take a crack at it?

iamorphen commented 2 weeks ago

I’ll give it a go. When I first opened this, I was a new user with no idea what we ought to do, but I think I’ve spent enough time with the tool now. I’m away today but should have something by around tomorrow.

2024年7月14日 (日) 06:00, Vincent Prouillet @.***(mailto:2024年7月14日 (日) 06:00, Vincent Prouillet < 送信:

We should probably rewrite the getting started page to avoid those issues, anyone wants to take a crack at it?

— Reply to this email directly , view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>