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

Taxonomy containing a locale string breaks taxonomy_list links #2621

Open
BenjaminAndre opened this issue Aug 23, 2024 · 2 comments
Open

Taxonomy containing a locale string breaks taxonomy_list links #2621

BenjaminAndre opened this issue Aug 23, 2024 · 2 comments

Comments

@BenjaminAndre
Copy link

Bug Report

Environment

Zola version: 0.19.2

Expected Behavior

If I write (in a template but probably in most places)

<a href="{{ get_url(path='genres', lang=lang) }}">
	Genres
</a>

I expect the French (main language) to link to root/genres, and the English secondary language to link to root/en/genres

Current Behavior

The English version leads also to root/genres just like the French version. Which, for the user, looks like he falls back to French.

Step to reproduce

Since my other taxonomies (tags and authors) don't have the same problem and I investigated a little, I suspect it's the en in the taxonomy (genres) that causes the problem.
I'd bet it messes up a regex somewhere in the get_url macro.

@Keats
Copy link
Collaborator

Keats commented Aug 26, 2024

It looks like lots of people (#2598) are confused about get_url so it should probably be changed.

Here's a short version of what it does: #2598 (comment)

It should probably be split into several functions rather than one function searching through many things.

@brianmay
Copy link

brianmay commented Nov 1, 2024

When even the docs are confused about what get_url can do (see https://www.getzola.org/documentation/content/image-processing/#creating-picture-galleries) it is not surprising users are confused also.

There probably does need to be a way of mapping an internal path to an external URL. i.e. just like get_link(path="@/...") but works with more then just md files. And probably without requiring string concatenation.

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

3 participants