I’d like to change the “tags” permalink to a different name without changing the content. I was able to do this with posts in v.115 using permalink changes in my config file, but I don’t know if this is possible with tags.
Original: host/tags/tag-name
New: host/section/tag-name
Also, is “section” a reserved term?
You can do this (with a major caveat - see my edit below).
Add a file /tags/_index.md
in your content
directory with the following frontmatter:
+++
url = "/section"
+++
Edit: I’ve just seen, that this will only change the url for the taxonomy page. The URL for the term pages still contain tags
. Is this a bug?
In the same way, you could adjust the URLs for each term - but that would be an administrative nightmare.
Yeah, I thought this could be changed in the config file with the new permalinks changes in v115.
Nice hint. Obviously I have missed this change.
Instead of my above changes, add this to your config.toml
(worked for me):
[permalinks]
[permalinks.term]
tags = '/section/:slug/'
[permalinks.taxonomy]
tags = '/section/'
1 Like
Nice. That did it! Thank you!
Also, I’ve read elsewhere that permalinks should be placed on the bottom of the config file, which made this work for me. Not sure if that’s documented.
1 Like
Arif
November 12, 2023, 12:02am
6
Not really. Just ensure that any top level code is placed at the top of your config file. So, for example, baseURL
, title
, theme
, copyright
, etc.
1 Like
system
Closed
November 14, 2023, 8:04pm
8
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.