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

Feature request: section-specific taxonomies #2449

Open
imartayan opened this issue Mar 4, 2024 · 5 comments
Open

Feature request: section-specific taxonomies #2449

imartayan opened this issue Mar 4, 2024 · 5 comments

Comments

@imartayan
Copy link

Just as we can generate separate feeds for each section with generate_feed, it would be convenient to have section-specific taxonomies by defining a taxonomies field in the front matter of a section using the same syntax as in config.toml. The taxonomy files would then be generated at the section's root path (which is somehow related to #1820).

Use case

This would be very useful if we want to have multiple blogs living in different sections and we don't want them to share their taxonomies. Right now, my workaround is to define a new global taxonomy for each of these sections (e.g. section1-tags, section2-tags...) but that's not very practical and the taxonomy files are not stored in the section's folder.

@Keats
Copy link
Collaborator

Keats commented Mar 11, 2024

Let's see if there are more people that want that but I don't think it would make sense to add imo

@matthillco
Copy link

This sounds like the same thing I requested in the discourse:
https://zola.discourse.group/t/more-flexible-taxonomies/1670
Global taxonomies are quite limiting, so please consider this a +1 for this feature.

@matthillco
Copy link

matthillco commented Jun 13, 2024

Out of interest, is there a workaround for this feature request that can be used right now? I frequently need to have top-level sections with a taxomony just for that section and I can't see anyway of achieving it with Zola right now. For example, I need this sort of setup:

/journal - zola section
/journal/taxonomy - taxonomy list template
/journal/taxonomy/term - taxonomy single term template

It's very limiting not being able to use the above structure. Right now I have to use the taxonomy with a top level url and that means it's no longer a sensible part of the site structure and navigation, because it sits outside the section I want it to appear to be a part of. So the best I can do is:

/journal - zola section
/taxonomy - taxonomy list template
/taxonomy/term - taxonomy single term template

Currently this means there's no relationship between the taxonomy and the section and this is the use case I'd like to solve.

@matthillco
Copy link

Any thoughts on the above @Keats? Is there a way of achieving the path structure I need using current taxonomy functionality? I appreciate you're very busy so I really appreciate any thoughts you could spare on this.

@Mandragorian
Copy link

Hi. My use case is that I would like to have zola behind a reverse proxy. Then allow it to serve the top level directory as my site's homepage, plus the /blog subdirectory as my blog. But I would like the reverse proxy to then be able to redirect other paths to other services, instead of the static web server that serves zola.

To be honest, I am not sure if that really make sense to want. Maybe there is a better way to do this with zola. But this is what I had in mind. I played around with the code yesterday and I think I managed to get it working with little change to the code. Of course I might be missing a ton of things since I don't have experience neither with zola nor with web development in general. I will make a PR and feel free to reject/give a ton of comments.

Mandragorian added a commit to Mandragorian/zola that referenced this issue Nov 15, 2024
As seen in getzola#2449, it might be nice to not serve the taxonomies in the
top level directory, but in a subfolder. This commit adds an option
"prefix" to the taxonomy definition.

The taxonomy then would be served in /<prefix>/<taxonomy_name> instead of
/<taxonomy>.
Mandragorian added a commit to Mandragorian/zola that referenced this issue Nov 15, 2024
As seen in getzola#2449, it might be nice to not serve the taxonomies in the
top level directory, but in a subfolder. This commit adds an option
"prefix" to the taxonomy definition.

The taxonomy then would be served in /<prefix>/<taxonomy_name> instead of
/<taxonomy>.
Mandragorian added a commit to Mandragorian/zola that referenced this issue Nov 15, 2024
As seen in getzola#2449, it might be nice to not serve the taxonomies in the
top level directory, but in a subfolder. This commit adds an option
"prefix" to the taxonomy definition.

The taxonomy then would be served in /<prefix>/<taxonomy_name> instead of
/<taxonomy>.
Mandragorian added a commit to Mandragorian/zola that referenced this issue Nov 15, 2024
As seen in getzola#2449, it might be nice to not serve the taxonomies in the
top level directory, but in a subfolder. This commit adds an option
"prefix" to the taxonomy definition.

The taxonomy then would be served in /<prefix>/<taxonomy_name> instead of
/<taxonomy>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants