Autosetting Title Based on Folder Name

My Content tree looks like this:

content/
├── about
│   ├── index.md
│   └── pic.jpg
└── posts
    ├── firstpost
    │   └── index.md
    └── secondpost
        └── index.md

I am trying to set up an archetype for new posts (named archetypes/post-bundle/index.md)

---
title: "{{ .ContentBaseName }}"
date: {{ .Date }}
draft: true
tags: []
categories: []
type: "post"
toc: true
body_classes: "blog"
---

The problem is, this just always sets the title to “Index” which is not what I want. According to these docs, it seems like it should set the title to the name of the containing folder as it is a leaf bundle (I think, still new to hugo, but I tried to read all the docs before diving in…). I call the archetype as such:

hugo new --kind post-bundle posts/

Does anyone know why this wouldn’t be working?

Have you tried it as?

{{ .File.ContentBaseName }}

Yeah, if I do that in my archetype it just ends up showing (same thing, but now lowercased)

title: "index"

Hi,

Have you tried using the example here?

title: "{{ replace .Name "-" " " | title }}"

For me, doing so and running hugo new --kind post-bundle posts/some-post produces

# content/posts/some-post/index.md
title: "Some Post"
2 Likes

I must have overlooked that one, that works perfectly. Thank you!