adfaure / kodama-theme

Theme for zola inspired by hugo academic theme.
https://adfaure.github.io/kodama-theme/
MIT License
18 stars 10 forks source link

Error: Failed to serve the site due to `resize_image` function and TOML parsing issue #17

Open antmoev opened 3 months ago

antmoev commented 3 months ago

Hello,

I encountered two errors while trying to serve my site using Zola with this theme. Below are the details:

Error 1: Function call resize_image failed

Command:

$ zola serve

Output:

Building site...
Checking all internal links with anchors.
> Successfully checked 0 internal link(s) with anchors.
-> Creating 0 pages (0 orphan) and 0 sections
Error: Failed to serve the site
Error: Failed to render section '/Users/maf88/Workspace/__JUNK__/antmoev.github.io/content/_index.md'
Error: Reason: Failed to render 'index.html' (error happened in 'base.html').
Error: Reason: Function call 'resize_image' failed
Error: Reason: Variable `config.extra.favicon` not found in context while rendering 'index.html'

Error 2: TOML parsing issue with the date field in the header

Command:

$ zola serve

Output:

Building site...
Error: Failed to serve the site
Error: Error when parsing front matter of section `/Users/maf88/Workspace/__JUNK__/antmoev.github.io/content/_index.md`
Error: Reason: TOML parse error at line 3, column 1
  |
3 | date = 2020-07-09
  | ^^^^
unknown field `date`, 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`

Steps to reproduce:

  1. Clone the repository into themes/
  2. Update config.toml to include theme = "kodama-theme"
  3. Copy the files in themes/kodama-theme/content to the app ./content directory
  4. Run zola serve

Additional context:

It seems that the resize_image function is failing due to a missing config.extra.favicon variable in the context while rendering index.html. Additionally, the date field in the front matter of _index.md is causing a TOML parsing error.

Any help resolving these issues would be greatly appreciated.

Thank you!

adfaure commented 3 months ago

Hello,

For the first error, it looks like the config.toml requires a field favicon pointing to an image that will be the favicon of your site.

[extra]
favicon = "static/img/avatar.jpg"

For the second error, I am trying to reproduce it, I will give you a heads-up when I succeed.

adfaure commented 3 months ago

For the second error, I raised an issue upstream: https://github.com/getzola/zola/issues/2558

For the moment, if you can use zola 0.18.0 that should let you continue to work on your website :)

adfaure commented 3 months ago

Hi ! Zola dev has answered. This is an error in the example in the theme. date is not allowed in the section front matter (it makes sense).

Let me know if it fixes your issue.