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 925 forks source link

Breaking changes documentation for v0.19 (generate_feeds, feed_filenames, path..) #2566

Closed vvzen closed 3 weeks ago

vvzen commented 3 weeks ago

Bug Report

Environment

Zola version: v0.19.1

Expected Behavior

zola serve works.

Current Behavior

zola serve reports an error when parsing the FrontMatter of some pages.

Step to reproduce

Hi all,

My last zola binary was v18.0 (built from source with HEAD at 8aedec98). After updating to v19.1, I'm seeing a few changes that "broke" the generation of my website (e.g. running zola serve worked previously but doesn't now).

A few of those were easy to catch, like generate_feed that became generate_feeds, and feed_filename that become feed_filenames and should now be an array (https://github.com/getzola/zola/pull/2477).

But I'm seeing other things like:

$ zola serve
Building site...
Error: Failed to serve the site
Error: Error when parsing front matter of section `/home/vv/dev/blog/[redacted]/content/portfolio/_index.md`
Error: Reason: TOML parse error at line 2, column 1
  |
2 | path = "portfolio"
  | ^^^^
unknown field `path`, expected one of `title`, `description`, `sort_by`, `weight`, `draft`, `template`, `paginate_by`, `paginate_reversed`, `paginate_path`, `insert_anchor_links`, `render`, `redirect_to`, `in_search_index`, `transparent`, `page_template`, `aliases`, `generate_feeds`, `extra`

which are taking a bit more time for me to understand.

I know that in SemVer v0.* means that any breaking is technically okay, but it would still be nice to give people a way to understand how to migrate their websites to work with the latest version (I don't see anythinig like that in the changelog right now).

Do you have any ideas on what changed so that path stopped being supported ? I used it to provide a custom url for a specific page, with https://github.com/pawroman/zola-theme-terminimal as my theme.

Thanks!

V

Keats commented 3 weeks ago

We turned on the serde feature to disable all unknown fields. Sections don't have a path attribute on the front-matter, only pages do.

vvzen commented 3 weeks ago

Gotcha, thanks for the swift reply and for the pointer! I was able to get things up and running again after a few tweaks to my theme, and after removing all usage of path (which was probably just not doing anything anyway, I can imagine).