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

Remove path frontmatter on section as per Zola 0.19 breaking changes #24

Merged

Conversation

Horgix
Copy link
Contributor

@Horgix Horgix commented Jul 24, 2024

Current behavior

When building a site with Zola and this theme along with the sample/demo content, or even just running zola check on such a setup, it currently fails with the following:

Checking site...
Error: Failed to check the site
Error: Error when parsing front matter of section `/home/horgix/projects/blog/content/blog/_index.md`
Error: Reason: TOML parse error at line 3, column 1
  |
3 | path = "blog"
  | ^^^^
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`

Explanation

The Zola 0.19 release, along with other changes, introduced #[serde(deny_unknown_fields)] on the Zola configuration validation.

It also turns out that the path key in the Zola files frontmatter is only valid for files and not for sections :

From https://www.getzola.org/documentation/content/overview/ (emphasis and ellipsis mine):

You might have noticed a file named _index.md [...]. This file is used to store both the metadata and content of the section itself and is not considered a page.

And indeed, the path frontmatter key is only documented on pages: https://www.getzola.org/documentation/content/page/#front-matter.

Also see getzola/zola#2566 (comment) for the upstream discussion.

Fix

This PR proposes to fix that by simply removing the path configuration on the blog/ section configuration 🙂

Tested locally and it works fine.

@Speyll Speyll merged commit a1b6e46 into Speyll:main Jul 31, 2024
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

Successfully merging this pull request may close these issues.

2 participants