summaryrefslogtreecommitdiffstats
path: root/create
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-11-01 20:30:34 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-11-01 21:06:39 +0100
commit30aba7fb099678363b0a4828936ed28e740e00e2 (patch)
tree59e803a1a240e81799285e356e4127463fc7b0c0 /create
parent04a3b45db4cd28b4821b5c98cd67dfbf1d098957 (diff)
source: Make ContentBaseName() return the directory for branch bundles
Fixes #9112
Diffstat (limited to 'create')
-rw-r--r--create/content_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/create/content_test.go b/create/content_test.go
index 802e494c4..6f0ed8c86 100644
--- a/create/content_test.go
+++ b/create/content_test.go
@@ -50,6 +50,8 @@ func TestNewContent(t *testing.T) {
{"No archetype", "", "sample-3.md", []string{`title: "Sample 3"`}}, // no archetype
{"Empty archetype", "product", "product/sample-4.md", []string{`title = "SAMPLE-4"`}}, // empty archetype front matter
{"Filenames", "filenames", "content/mypage/index.md", []string{"title = \"INDEX\"\n+++\n\n\nContentBaseName: mypage"}},
+ {"Branch Name", "name", "content/tags/tag-a/_index.md", []string{"+++\ntitle = 'Tag A'\n+++"}},
+
{"Lang 1", "lang", "post/lang-1.md", []string{`Site Lang: en|Name: Lang 1|i18n: Hugo Rocks!`}},
{"Lang 2", "lang", "post/lang-2.en.md", []string{`Site Lang: en|Name: Lang 2|i18n: Hugo Rocks!`}},
{"Lang nn file", "lang", "content/post/lang-3.nn.md", []string{`Site Lang: nn|Name: Lang 3|i18n: Hugo Rokkar!`}},
@@ -275,6 +277,12 @@ title: Test
content: "#+title: {{ .BaseFileName | upper }}",
},
{
+ path: filepath.Join("archetypes", "name.md"),
+ content: `+++
+title = '{{ replace .Name "-" " " | title }}'
++++`,
+ },
+ {
path: filepath.Join("archetypes", "product.md"),
content: `+++
title = "{{ .BaseFileName | upper }}"