I understand this amounts to asking too much of a static website generator, but I have a real-life situation that would like this feature / possibility (if it exists in Hugo).
Is it possible to change the slug for a tag? Here’s an example of what I am asking.
I am migrating my site from wordpress to hugo. In 1 of my posts, The
tag is Square’s Privacy Issues and the
url-slug for that
Wordpress allows you to edit the tag slugs, and since it is database driven, I can see how easy that was to implement in that CMS.
Can I do something similar in Hugo?
This become especially important in cases where a “belongs to” word gets pluralized.
Ex: Square’s Privacy tag slug becomes squares-privacy and J-Lo’s tag slug becomes j-los
Pages have a
slug config option, but if it really is tags (aka taxonomy in Hug) you are talking about, then currently no.
There are plans making this happen, but it will take some time.
Until then you might get closer to what you want by:
In the site configuration.
Yes, I am talking about tag
I just saw the documentation for
preservetaxonomynames: true in this commit.
I understand it for most part. Like you said, the
preservetaxonomynames: true works on normalizing the urls.
I was wondering how I get to this documentation from the command line?
About this taxonomy terms slugs, I have one more question. The referenced commit states, that when
preserveTaxonomyNames is set to
false , “Gérard Depardieu” will become
Gerard Depardieu when listed on listing pages.
My question is about slugs themselves. With this setting untouched (so by default I assume FALSE), the slug should become
gerard-depardieu but it is actually
gérard-depardieu with an accent.
So my tags and categories have accents in their slugs. Anyway to avoid this?
And yes, I’m french
The proper fix for this is related to an issue that is labeled “Nodes vs Page” or something, that is in the pipeline.
The current workaround/hack is to keep a mapping of term and name/description/whatever in a map in a data file.
Ok, thanks for the info, I’ll manage my slugs this way until the issue is resolved.
A post was split to a new topic: I need slugs for tags