Use filename as title when it's not defined in front matter


Note: I’m new to Hugo, so If there’s a better way about this fell free to correct me.

For now I use {{.File.TranslationBaseName}} in template cause {{.Title}} is empty string. I thought it’s better to store it in the title variable, as themes out there are already using it. Also we could use file dates for date and lastmod.

I thought this is a nice feature especially when there’re a lot of content files imported from another system.

For myself, I use nvALT to take markdown notes. nvALT has already handle the title and date in this way, now I want to use Hugo for building the website. But maintaining notes metadata by hand is not a good practice IMHO.

What do you think?


Sounds reasonable, but could you create an issue on GitHub?


Sure, it’s here:

Glad you say so :wink:


this is related/similar to Default title to first header in content? which I got a working patch for.