Custom Slug format?

Hi. I started to switch from “frog” to hugo for my blog (and I really like hugo so far).

The thing is: frog uses a URL schema I cannot reproduce with hugo (yet?) - although I want to keep backwards compability. Here’s an example: I have a Blog post with

  • Title: “ – Port to C++”
  • Frog URL: “/blog/2015/02/25/rate-sh-port-to-c/”
  • Hugo URL: “/blog/2015/02/25/”

Also, the hugo URL results in a 404. My hugo permalink config looks like this:

    blog = "/blog/:year/:month/:day/:slug"

So everything is fine but the slug. Is there a way to define a custom slug-generating function?

One idea would be to use the :filename, though that also contains the date, which I would need to strip of…

You can define a custom slug in the frontmatter with the slug variable.

1 Like

Awesome! That will do for me, thanks a lot for your answer!