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] Disable taxonomy output through configuration #1750

Closed
Stanko opened this issue Jan 30, 2022 · 9 comments
Closed

[Feature Request] Disable taxonomy output through configuration #1750

Stanko opened this issue Jan 30, 2022 · 9 comments
Assignees
Labels
done in pr Already done in a PR enhancement

Comments

@Stanko
Copy link

Stanko commented Jan 30, 2022

Thank you for the excellent work on zola! 🙌

I have a feature request, I'm using taxonomies (tags and category), but I would like them not the output all the pages in:

  • /tags
  • /tags/[name]
  • /category/
  • /category/[name]

The reason is that I use taxonomies these under the hood (tags are used in a naive related posts algorithm and categories are used to generate custom archive page). You can see my current archive page here, but that is a jekyll version, as I'm still in the process of migrating to zola.

I was hoping you could add an attribute to the taxonomy configuration (similarly to the feed option), something like this:

taxonomies = [
    { name = "category", output = false},
    { name = "tags", output = false},
]

Property could be also called ouputPages, renderPages, render... or anything along those lines.

I will look into code to see if I can pull it off myself, but I still haven't wrote a line of rust in my life 🙈

Thank you!


P.S. I initially thought of just removing /public/tags and /public/category after the build, but pages are also indexed in the sitemap. That was the moment I decided to open this issue 😬

@Keats
Copy link
Collaborator

Keats commented Jan 31, 2022

I think it makes, I need to refactor the code for taxonomies so don't worry about it, I'll handle it.

@Keats Keats self-assigned this Jan 31, 2022
@GlenDC
Copy link

GlenDC commented Apr 5, 2022

Is this issue still being worked on? If not I do not mind to contribute it, would just need some help and guidance.


Related to this issue. Besides toggling it on or off (the output), it would be cool for me if I could have it generate only the single pages, but not the list pages. As I do not have a use for the latter, while I do have one for the single ones.

Would this be considered as well please?

As a quick hack I use for my list.html of my taxonomies a soft link to my 404.html template. This is good enough for me, as the result is close enough, but it is not really the desired solution...

@Keats
Copy link
Collaborator

Keats commented Apr 6, 2022

I will handle that one in my current refactor, it's in progress but it's pretty big so it will take some time

@Stanko
Copy link
Author

Stanko commented Apr 6, 2022

At the moment I'm using a simple script to remove taxonomy output and entries from the sitemap:
EDIT - updated link: https://github.com/Stanko/Stanko.github.io/blob/69484e21afdbbf0455ab951c59303f188f6533ab/build.sh#L15-L19

@GlenDC
Copy link

GlenDC commented Apr 6, 2022

I was hoping the feed property would prevent it from wanting to generate the list.html one, but seems I misunderstand what feed means here, I suppose that one is more about the RSS feed.

@Keats
Copy link
Collaborator

Keats commented Apr 6, 2022

The feed is only there if you need to generate a RSS/atom feed for the taxonomies.

@Keats Keats added the done in pr Already done in a PR label Apr 27, 2022
@Keats
Copy link
Collaborator

Keats commented Apr 27, 2022

I've added it to the next branch if you want to try. It's called render = true | false.

@Stanko
Copy link
Author

Stanko commented May 2, 2022

Are there next builds available somewhere?

@Keats
Copy link
Collaborator

Keats commented May 2, 2022

You have to build the next branch from source, no pre-builds.

@Keats Keats closed this as completed in 84951d3 Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done in pr Already done in a PR enhancement
Projects
None yet
Development

No branches or pull requests

3 participants