Title and slug capitalized when setting custom permalink

I’ve set the permalink for my posts to the following:

  posts = "/posts/:year/:month/:slug/"

Let’s say I have a post titled «Lorem ipsum», in a file named /content/posts/2019-05-31-lorem-ipsum.md. The slug is not set in the front matter, only the title. With the above permalink configuration, I expect the link to the post to be the following:


However, I get:


With the default permalink configuration, the link is lowercased:


Is this intended? The docs say nothing about the title or slug being capitalized by default. Do I need to manually set the slug for all posts?

Hugo version: Hugo Static Site Generator v0.55.6/extended darwin/amd64 BuildDate: unknown

Hi @runar, welcome to the forums. So I think you may have a misunderstanding between Slug and Title. When specifying :slug in your permalink, that will look for a slug param in your page front matter, and if not found it will fall back to the title param.

I would recommend one of the following:

(1) Add a slug param to each page; or

(2) Instead of :slug, use :filename in your permalink, then rename your files appropriately.

Others may have better ideas on this.


Thank you for your reply, @zwbetz!

I am (and was) aware of the difference between Slug and Title, but I thought that the :title param of the permalink would get automatically lowercased, as in other frameworks.

Thank you for the explanation, and possible solutions!

A quick update: It seems, for reasons unknown, that I had the following in my config.toml:

disablePathToLower = true

The purpose of this option is to «not convert the url/path to lowercase», and the default value is false. Removing this line removes the need to manually add slugs to all posts.

This illustrates how important it is to check your configuration before trying to solve an issue! :sweat_smile:

1 Like