I'd like to propose a new permalink configuration value to join :year, :day et al. family: :taxonomy.
Expected behavior:
Given :taxonomy[taxonomy_name] is used in permalink config it is then converted to first term (slug) assigned to particular page.
Example: Let's assume we have following taxonomies:
taxonomies:
series: "series"
and Page content/movies/the-mask.md with content:
title: "The Mask"
series: ["Comedy"]
---
and following permalink configuration:
[permalinks]
movies = "/:section/:taxonomy[series]/:slug/"
Our movie page will be then available under /movies/comedy/the-mask/.
It might be also usable if one can enable generating aliases based on other terms assigned to page, but it's not necessary.
The same can be achieved via nested Sections, but it's less flexible from content authors perspective (taxonomies can be easily managed via CMS).
What do you think?
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
I really like this. To me :taxonomy would be more useful than :year and :day in permalinks.
@bep, @moorereason, @digitalcraftsman thoughts?
Sorry for bumping this issue, but I would find this very useful too.
I really like this. To me
:taxonomywould be more useful than:yearand:dayin permalinks.
Thank you for looking into this!
This would indeed be very useful. Bump.
I've been thinking about this functionality for some time, maybe I'll be able to propose some PR. My only doubt at the moment is the situation when page does not have a desired taxonomy assigned to it. All the current permalink configuration values are always present (or have fallback).
Back to my example from original idea:
title: "The Mask"
---
[permalinks]
movies = "/:section/:taxonomy[series]/:slug/"
What should Hugo do in such a situation?
I see two possible solutions:
:taxonomy and output /movies/the-mask/.WDYT?
Any update on this?
Most helpful comment
I really like this. To me
:taxonomywould be more useful than:yearand:dayin permalinks.@bep, @moorereason, @digitalcraftsman thoughts?