even icon indicating copy to clipboard operation
even copied to clipboard

Unknown taxonomy error

Open pianomanfrazier opened this issue 6 years ago • 11 comments

I ran zola init and then followed the directions for the Even theme and I got the following error:

$ zola serve
Building site...
-> Creating 1 pages (0 orphan), 0 sections, and processing 0 images
Error: Failed to render page 'zola-blog/content/first_post.md'
Reason: Failed to render 'even/templates/page.html'
Reason: `get_taxonomy_url` received an unknown taxonomy as kind: tags

Here is a gist of all the files I created. https://gist.github.com/pianomanfrazier/9f76f42ee77f544bbb6ddfa11a5ad255

I am not sure how to fix the error. I have the taxonomy tags defined in my config.toml and then in /content/first_post.md I define some tags.

Using zola 0.7.0

pianomanfrazier avatar May 08 '19 05:05 pianomanfrazier

After playing with it a bit it seems that this error comes up when the reloading server is running and I change a tag in the post metadata to something new. The issue is probably with zola.

pianomanfrazier avatar May 08 '19 05:05 pianomanfrazier

That's caused by the page.html template.

It can be reproduced within even.

  1. zola serve
  2. edit content/first_post.md and change a tag to another, non-existing tag (e.g. tag1 -> tag2)
  3. the serve log shows:
Change detected @ 2019-05-08 23:47:37
-> Content changed /Users/jhereth/repos/even/content/first_post.md
Failed to build the site
Error: Failed to render page '/Users/jhereth/repos/even/content/first_post.md'
Reason: Failed to render 'page.html'
Reason: `get_taxonomy_url`: couldn't find `tag2` in `tags` taxonomy
Done in 11ms.

The error message comes from page.html, L48 - the renderer needes the urls for all tags of the page - but the new tag is not yet known.

The error seems similar to zola's #319 but also happens on non-draft pages.

Not sure if this can be fixed within the theme.

jhereth avatar May 08 '19 22:05 jhereth

So it looks like the issue is that on reload, the templates are re-rendered without recreating the get_taxonomy function first? If so that is definitely a bug in Zola

Keats avatar May 11 '19 01:05 Keats

@Keats yes, it happens on zola serve only, zola build works fine. I didn't find where the difference comes from.

jhereth avatar May 11 '19 05:05 jhereth

I am getting it both with server and build. Using anpu theme.

MarcelRobitaille avatar Dec 09 '21 14:12 MarcelRobitaille

which version of zola?

Keats avatar Dec 09 '21 14:12 Keats

0.14.1

MarcelRobitaille avatar Dec 09 '21 14:12 MarcelRobitaille

Sorry, I realize this is a different theme. I thought this was zola. I will try with this theme to see if it is the theme or config. The error message looks identical

Edit: Yup, same error with even theme

MarcelRobitaille avatar Dec 09 '21 14:12 MarcelRobitaille

Sorry, I realize this is a different theme. I thought this was zola. I will try with this theme to see if it is the theme or config. The error message looks identical

Edit: Yup, same error with even theme

I think you may be filling in taxonomy in config.toml below [markdown]. I was having trouble with the same error, but when I changed where I filled it in, that error did not occur.

DamianHayden avatar Dec 10 '21 06:12 DamianHayden

Wouldn't you know it. I copied the config.toml from the theme, which had it in the [markdown] block. I just checked the config.toml in this repo, and works a charm. Thank you so much!

MarcelRobitaille avatar Dec 10 '21 17:12 MarcelRobitaille

I've run in to this issue too.

Error: Reason: `get_taxonomy_term_by_name` received an unknown taxonomy as kind: project

I get this error with this code:

get_taxonomy_term(kind="project", term="foo")

However this works:

get_taxonomy(kind="project")

I don't have the [markdown] config.toml issue mentioned above

jimmyff avatar May 25 '24 22:05 jimmyff