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

Hugo no longer supports taxonomy separation #5513

Closed
randallmlough opened this Issue Dec 10, 2018 · 9 comments

Comments

Projects
None yet
5 participants
@randallmlough
Copy link

randallmlough commented Dec 10, 2018

I'm not sure if this feature was originally intended with Hugo (it's not documented), but one aspect I used a lot was the ability to separate taxonomies from each other.

My use case:
I have a number of taxonomies/listing pages for different purposes as shown below. I choose this approach for the user experience, I didn't want to have all this content on a single /categories listing page. It would have been confusing to see an ebook, job posting, and a blog post all on the same listing page. To work around this I was able to include slashes in the taxonomies config option which hugo was able to understand.

Examples here of it working:
RetailOps.com/blog/topics/amazon/
or
Retailops.com/resources/categories/ebook/

and my config

[taxonomies]
"resrouces/tag" = "resources/tags"
"resrouces/category" = "resources/categories"
"partners/tag" = "partners/tags"
"partners/category" = "partners/categories"
"news/tag" = "news/tags"
"news/category" = "news/categories"
"careers/tag" = "careers/tags"
"careers/department" = "careers/departments"
"customers/tag" = "customers/tags"
"customers/type" = "customers/types"
"blog/tag" = "blog/tags"
"blog/topic" = "blog/topics"

I get that hugo may not have been meant to work this way, but for a website that offers a wide range of content – blogs, ebooks, PRs, and/or unique listings like integrations – this has been a very useful feature. Sadly this feature seems to have been disabled/broke in hugo 0.48 due to this issue.

The last working release is hugo 0.47.1

Can we discuss reintroducing this capability?

@bep

This comment has been minimized.

Copy link
Member

bep commented Dec 10, 2018

@bep bep added this to the v0.53 milestone Dec 10, 2018

@bep

This comment has been minimized.

Copy link
Member

bep commented Dec 10, 2018

I had a nagging feeling when I merged the mentioned PR.

@onedrawingperday didn't you have a similar issue?

@moorereason

This comment has been minimized.

Copy link
Contributor

moorereason commented Dec 10, 2018

Can you solve this with custom permalinks per taxonomy? I believe that's what @onedrawingperday was doing. See his example config.

@onedrawingperday

This comment has been minimized.

Copy link
Member

onedrawingperday commented Dec 11, 2018

@onedrawingperday didn't you have a similar issue?

Similar but not quite the same.

@randallmlough

This comment has been minimized.

Copy link

randallmlough commented Dec 11, 2018

Can you solve this with custom permalinks per taxonomy? I believe that's what @onedrawingperday was doing. See his example config.

I looked at @onedrawingperday config and I'm not sure if this would solve it... Unless I'm thinking about it incorrectly.

How would I go about having multiple "categories" like resources/category, news/category and partners/category? By using the example config it seems like I could only have 1 taxonomy labeled as "category" and it would be permanently tied – by using the permalink method – to only one of the sections above.

Also, doing a quick test it doesnt appear to work correctly.

Example:

[taxonomies]
"blog" = "blog/topics" 
# Tried a number of variations to the above like blog = topics
[permalinks]
"blog" = "/blog/topic/:title/"
# again tried a number of variations

sitemap.xml outputs as
For a page

<url>
    <loc>/blog/topic/3-simple-ways-to-improve-your-inventory-management-system-today/</loc>
    <lastmod>2018-07-17T16:01:21-07:00</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.5</priority>
  </url>

for a category – this doesnt appear to work at all

<url>
    <loc>/blog-topics/amazon/</loc>
    <lastmod>2018-07-27T12:36:24-07:00</lastmod>
    <changefreq>monthly</changefreq>
  </url>
@onedrawingperday

This comment has been minimized.

Copy link
Member

onedrawingperday commented Dec 11, 2018

@randallmlough

[taxonomies]
"blog" = "blog/topics" 
# Tried a number of variations to the above like blog = topics
[permalinks]
"blog" = "/blog/topic/:title/"

In linked config I am tricking Hugo into first configuring -for example- a year taxonomy i.e. year = "year" and then setting up the permalink as year = "/drawing/:slug/"

You are configuring a blog taxonomy as "blog/topics" and then trying to set permalinks for blog which is different and bound to not work for "blog/topics" .

@bep bep added Bug and removed NeedsInvestigation labels Dec 11, 2018

@bep

This comment has been minimized.

Copy link
Member

bep commented Dec 11, 2018

I'm going to force a decision here, as this clearly takes more time than the original issue warrants (it was reported by very few users).

If find @randallmlough 's use of taxonomies very useful and I don't want that blocked by this. While undocumented, the above broke this feature. So I'm rolling back that commit, and we will have to look for another way to handle slashes. A taxonomy name is foremost a path identifier -- the slashes should go into the title. That may be harder to "do simple", but it's the correct way.

@bep bep self-assigned this Dec 11, 2018

@bep

This comment has been minimized.

Copy link
Member

bep commented Dec 13, 2018

Looking at this, I think this is fixable without rolling back the referenced "slash fix".

bep added a commit to bep/hugo that referenced this issue Dec 13, 2018

bep added a commit to bep/hugo that referenced this issue Dec 13, 2018

bep added a commit to bep/hugo that referenced this issue Dec 13, 2018

@bep bep removed the NeedsInvestigation label Dec 13, 2018

bep added a commit to bep/hugo that referenced this issue Dec 14, 2018

@bep bep closed this in #5519 Dec 14, 2018

bep added a commit that referenced this issue Dec 14, 2018

@soulteary

This comment was marked as outdated.

Copy link

soulteary commented Jan 14, 2019

thanks you for your work. @bep

but it seems that i've to lock hugo version at 0.2x... lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment