Base content title on ContentBaseName (#440)

With Hugo v0.88.1 and earlier, ContentBaseName and TranslationBaseName
both returned "index" when creating a leaf bundle with hugo new. This is
a known bug, addressed with https://github.com/gohugoio/hugo/pull/9045.

With this PR:

  hugo new post/my-first-post/index.md

will produce:

  title: "My First Post"

instead of:

  title: "Index"
This commit is contained in:
Joe Mooring 2021-12-02 11:51:01 -08:00 committed by GitHub
parent 3710f7e92a
commit 24dcf32ffd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
--- ---
title: "{{ replace .TranslationBaseName "-" " " | title }}" title: "{{ replace .File.ContentBaseName "-" " " | title }}"
date: {{ .Date }} date: {{ .Date }}
tags: [] tags: []
featured_image: "" featured_image: ""