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

Empty string used as taxonomy term breaks taxonomy list page #2085

Closed
mprasil opened this issue Jan 24, 2023 · 1 comment
Closed

Empty string used as taxonomy term breaks taxonomy list page #2085

mprasil opened this issue Jan 24, 2023 · 1 comment
Labels
bug done in pr Already done in a PR

Comments

@mprasil
Copy link

mprasil commented Jan 24, 2023

Bug Report

Environment

Zola version: 0.16.1

Expected Behavior

I think throwing an error would be most appropriate.

Current Behavior

When adding an empty string instead of proper taxonomy term, Zola renders page for this single term instead of listing all terms.

Step to reproduce

In the page frontmatter add any taxonomy with empty string as term:

+++
title = "Reproduce bug"
[taxonomies]
tag = [""]
+++

Then visit ${baseurl}/tag/ in your browser, you'll see list of articles that are tagged with "" instead of list of tags like one would expect.

I assume this is due to tag named "" being sluggified to empty string which results in conflicting /tag/ path being generated overwriting the file that's normally used for listing all tags.

@mprasil
Copy link
Author

mprasil commented Jan 24, 2023

I realize, that this is somewhat user error as the empty tag was indeed added to the list of tags, but I think virtually all such cases would not be intentional. (eg. user adding just empty string as placeholder while writing the page, then forgetting to update it)

On top of that, the issue manifests in a place where user is unlikely to check and breaks the site somewhat silently which makes for a nasty issue to spot. It took me a while to notice this and quite a while to figure out what's going on - and that was me actually tinkering with the the page look, so I was actually working on that specific template. Otherwise I can see this going unnoticed for a while. 😅

@Keats Keats added the bug label Jan 24, 2023
Keats added a commit that referenced this issue Jan 24, 2023
@Keats Keats added the done in pr Already done in a PR label Jan 24, 2023
@Keats Keats closed this as completed in 60d8425 Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

2 participants