Skip to content

get_taxonomy_term does not handle terms with special characters #2829

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

Open
tzinm opened this issue Mar 20, 2025 · 3 comments
Open

get_taxonomy_term does not handle terms with special characters #2829

tzinm opened this issue Mar 20, 2025 · 3 comments
Labels

Comments

@tzinm
Copy link

tzinm commented Mar 20, 2025

Bug Report

Environment

Zola version: 0.20.0

Expected Behavior

The get_taxonomy_term function should correctly retrieve terms that contain special characters, such as accents.

Current Behavior

When passing a term with special characters (e.g., "acción") to get_taxonomy_term, Zola returns the following error:

Error: Reaseon: `get_taxonomy_term` received an unknown term: acción

I attempted to normalize the term using [slugify](https://keats.github.io/tera/docs/#slugify), but the issue persists.

Step to reproduce

  1. Create a taxonomy (e.g., tags) containing a term with special characters (acción).
  2. Use get_taxonomy_term(kind="tags", term="acción") in a
  3. Run Zola and observe the error.

This issue was initially discussed in the Zola forum: Conditionally displaying RSS Feed icons for tags based on feed availability

@Keats Keats added the bug label Mar 31, 2025
@edgarogh
Copy link

I've tried looking into this but I cannot reproduce your issue. Do you have a minimal reproducible example? (as repo or zip archive)

Could it be possible that the acute O character is not the same in your page and in your get_taxonomy_term invocation? There are multiple Unicode characters that are distinct and look like this. For instance, these 2 are different:

ó,

The first is a single codepoint, the second one is a combining character and the letter o.

@tzinm
Copy link
Author

tzinm commented May 13, 2025

Hello @edgarogh, thank you for taking the time to review this issue.

As I have forked the theme I use in my personal blog to contribute with small improvements, I have created a branch where the bug is easily replicated.

The only commit of this branch contains a modified list.html file.

When you run zola serve you will see the error.

Building site...
Checking all internal links with anchors.
> Successfully checked 96 internal link(s) with anchors.
-> Creating 70 pages (0 orphan) and 19 sections
Error: Failed to serve the site
Error: Failed to render a list of tags page.
Error: Reason: Failed to render 'tags/list.html'
Error: Reason: Function call 'get_taxonomy_term' failed
Error: Reason: `get_taxonomy_term` received an unknown term: anàlisi de dades

@edgarogh
Copy link

Indeed, I can reproduce. I'll investigate 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants