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
bep
April 27, 2015, 9:57am
2
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 !
bep
June 12, 2015, 6:04pm
4
Please open an issue at GitHub.
bep
June 12, 2015, 6:42pm
5
Curious: What is the build time diff between Hugo and Jekyll (excluding the magic seds)?
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 ?
bep
June 13, 2015, 10:38am
8
That would solve half the initial problem described, I guess.
Yes, you’re right. My issue is not really accurate, then… So, edited !
aik
September 24, 2016, 6:31pm
10
(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?
aik
September 27, 2016, 4:14pm
11
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 ^^
alexandros
Split this topic
May 7, 2020, 3:07pm
12