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

**URL:** <https://discourse.gohugo.io/t/use-filename-as-title-when-its-not-defined-in-front-matter/7965>\
**Category:** feature\
**Created:** [August 15, 2017, 7:37am UTC](https://discourse.gohugo.io/t/use-filename-as-title-when-its-not-defined-in-front-matter/7965 "2017-08-15T07:37:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![idealhack](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/idealhack/32/25091_2.png) [@idealhack](https://discourse.gohugo.io/u/idealhack)\
**Post date:** [August 15, 2017, 7:37am UTC](https://discourse.gohugo.io/t/use-filename-as-title-when-its-not-defined-in-front-matter/7965/1 "2017-08-15T07:37:20Z")

</div>

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](http://brettterpstra.com/projects/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?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [August 15, 2017, 8:08am UTC](https://discourse.gohugo.io/t/use-filename-as-title-when-its-not-defined-in-front-matter/7965/2 "2017-08-15T08:08:32Z")

</div>

> [@idealhack](#):
>
> What do you think?

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

---

<div class="post-metadata">

**Author:** ![idealhack](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/idealhack/32/25091_2.png) [@idealhack](https://discourse.gohugo.io/u/idealhack)\
**Post date:** [August 15, 2017, 8:25am UTC](https://discourse.gohugo.io/t/use-filename-as-title-when-its-not-defined-in-front-matter/7965/3 "2017-08-15T08:25:53Z")

</div>

Sure, it’s here: [https://github.com/gohugoio/hugo/issues/3805](https://github.com/gohugoio/hugo/issues/3805)

Glad you say so 😉

---

<div class="post-metadata">

**Author:** ![maxandersen](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maxandersen/32/3750_2.png) [@maxandersen](https://discourse.gohugo.io/u/maxandersen)\
**Post date:** [September 4, 2017, 12:00pm UTC](https://discourse.gohugo.io/t/use-filename-as-title-when-its-not-defined-in-front-matter/7965/4 "2017-09-04T12:00:34Z")

</div>

this is related/similar to [Default title to first header in content?](https://discourse.gohugo.io/t/default-title-to-first-header-in-content/8179) which I got a working patch for.
