From df5e8c0cb0fb8b7ff0f1b412966160c3a40d365c Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Fri, 29 Oct 2021 19:13:42 -0700 Subject: [PATCH] Base content title on ContentBaseName 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" --- archetypes/default.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archetypes/default.md b/archetypes/default.md index 01392c0..6398a82 100755 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,5 +1,5 @@ --- -title: "{{ replace .TranslationBaseName "-" " " | title }}" +title: "{{ replace .File.ContentBaseName "-" " " | title }}" date: {{ .Date }} tags: [] featured_image: ""