How to get a cleaner url with single taxonomy type ( boolean taxonomy ) /reviews/ instead of /categories/review/

I am only using a single taxonomy type on my website ( categories )
right now all the taxonomy term list pages have URLs like the following:

  • baseURL/categories/review/
  • baseURL/categories/life/
  • baseURL/categories/fun/

but instead I want them to be like this:

  • baseURL/reviews/
  • baseURL/life/
  • baseURL/fun/

And I want the actual single pages to have URLs like this:

  • baseURL/ironman-review/

So what I thought would have been possible is having a boolean taxonomy type, that you could opt into in the front matter, without having to specify a sub type, but that does not seem to be a thing (afaik).

Maybe the solution lies in Aliases, but I wouldn’t want to have 2 different URLs to link to the same thing.

So maybe what I want requires some custom code, but I haven’t gotten into that yet.

I did not test this, but I would expect that the following in your config.toml will do the trick:

categories = "/:title/"

Thanks for the quick reply. :grinning: I hope this will help others as well.
Slight issue still, Is it possible to delete the baseURL/categories/ taxonomies listing page?

No, but you could just not create it in the first place :smiley:

It’s a relatively new feature (0.76.0) and you need to add some frontmatter to the files that you don’t want to build.

Thanks, it works :grinning:

I’ve made a new folder called categories and within it, 1 file called with the following content:

  render: false

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.