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

Unknown taxonomy error #28

Open
pianomanfrazier opened this issue May 8, 2019 · 10 comments
Open

Unknown taxonomy error #28

pianomanfrazier opened this issue May 8, 2019 · 10 comments

Comments

@pianomanfrazier
Copy link

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
Copy link
Author

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.

@jhereth
Copy link

jhereth commented May 8, 2019

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.

@Keats
Copy link
Collaborator

Keats commented May 11, 2019

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

@jhereth
Copy link

jhereth commented May 11, 2019

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

@MarcelRobitaille
Copy link

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

@Keats
Copy link
Collaborator

Keats commented Dec 9, 2021

which version of zola?

@MarcelRobitaille
Copy link

0.14.1

@MarcelRobitaille
Copy link

MarcelRobitaille commented Dec 9, 2021

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

@DamianHayden
Copy link

DamianHayden commented Dec 10, 2021

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.

@MarcelRobitaille
Copy link

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!

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

No branches or pull requests

5 participants