Change the URL for categories and tags

Hi everyone, I’m migrating my 4000+ blog from Jekyll. Friggen fast, spf13 and team have done an amazing job.

Still wrapping my head around Hugo taxonomies. Is it possible to change the permalink for category and tag archives? Specifically, looking to do this:

root.tld/categories/label -> root.tld/label [sic]
root.tld/tags/label -> root.tld/tag/label

Currently I do this in a post-generate script with a ton of sed. Ironically, this takes longer than Hugo does building the entire site :).

Cheers

Currently no, but it’s a good idea and It shouldn’t be too hard to fix. Could you add a GitHub issue?

I’d like the same thing but I’m not sure if work has been done on that matter. If I should open an issue on GitHub, let me know !

Please open an issue at GitHub.

Curious: What is the build time diff between Hugo and Jekyll (excluding the magic seds)?

Done ! https://github.com/spf13/hugo/issues/1208

Well, I just got an idea and I feel a little stupid now…

What if you just edit the config file and use only singular ? Like this :

[taxonomies]
    category = "category"
    tag = "tag"

Then, in every file, you use metadata in the same singular form. And now, the URL is singular too…

I don’t see any problem with this approach. But maybe I’m wrong ?

That would solve half the initial problem described, I guess.

Yes, you’re right. My issue is not really accurate, then… So, edited !

(Necro?)Bump.
I’d like the very same thing - do you mid sharing your script? Just so I get the idea – I’m not that good at sed stuff… Or is this possible now native hugo?

Well… as I bumped I feel I should share my personal solution.

For sections i just move the content of the section folder - excluding index.html - to root and replace every occourence of ‘/content/’ with ‘/’
find $folder -type f -print0 | xargs -0 sed -i 's/\/categories\//\//g'

I didn’t change post folder, as I kind of like it now ^^

A post was split to a new topic: Hide Nested Section from URL of content file?