Hi, I need help for solving confliction on permalink. I mean, I want to control what happens when two pages have the same permalink.
By defalut, Hugo seems to override the older one with newer one without warning.
Basically I set a date and a slug for the posts with filename (2019-10-26-this-is-a-slug.md
), and set my Permalink /:slug
.
I need some solution for this, like in these ways:
- automatically add some number to newer conflicting permalink. Like renaming
/posts/this-is-a-slug/
to/posts/this-is-a-slug-1/
- Raise an error when confliction found and abort building pages.
I have set my config.toml
as below:
baseURL = "http://example.org/"
languageCode = "en-us"
title = "My New Hugo Site"
theme = "ananke"
[permalinks]
posts = "/:slug/"
[frontmatter]
date = ["date", "publishDate", ":filename", "lastmod"]
I searched a lot and found nothing about how to control the conflicting permalinks.
Thank you in advance for helping me.