Avoiding Duplicate Post Names/URLs

So let’s say I have a blog. On January 1st of 2017 I create posts/happy-new-year.md. Then in 2018 I create posts/happy-new-year.md, see that it already exists, so I create posts/happy-new-year-2.md. Then in 2019 I try the previous two before settling on posts/happy-new-year-3.md.

Software like Wordpress might organize posts like /2019/01/01/happy-new-year and /2018/01/01/happy-new-year, avoiding the issue. Does hugo have any method for organizing posts by time automatically? Or is it on me to somehow do this manually (e.g., hugo new posts/2019/happy-new-year.md)

While I’m not sure how often this sort of thing is going to be a problem, I’d like to get ahead of it now so that URLs don’t need to change in the future.

Yep, you can do this through configuring permalinks in the config.toml file

I’m pretty sure you can also organise your posts in subdirectories, e.g. content/posts/2019/01 etc.

for config-file set

    post    = "/:section/:year/:month/:day/:title"

under content/<section> the structure does not matter