Issue setting different kinds of Permalinks

So my old nanoc site generated permalinks to my blog posts a certain way using “/year/month-day-title” and would strip words out of the title that Hugo doesn’t.

My workaround was going to be something like adding a section to the blog posts like “nanoc_title = ‘blah’” but when I try and set permalinks in my config to something like "posts = “:month-:day-:nanoc_title” I get a "permalink ill-formed error.

Is there a common workaround for managing these kinds of URL problems?

I don’t think it’s possible to generate permalinks partly based on a front matter variable. Would probably be helpful if that were possible, but that’s currently not the case.

But there are at least two ways you can approach this situation:

  • Use aliases to redirect the old posts to the new location with Hugo.
  • Use the slug front matter variable to specify the URL like you used previously with nanoc.

Hope this helps.

This could be a bug. But before that, can you provide a sample site repo that demonstrates that problem?

Actually nevermind, I didn’t read it carefully enough… I see that you used a custom placeholder there (:nanoc_title), and thus that error.

Aliases worked! Thank you for that, I was looking into changing the permalinks for so long but it turns out there’s a nice built in feature to solve the problem, go figure. Cheers!