summaryrefslogtreecommitdiffstats
path: root/create/content_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-06-23 09:29:59 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-06-23 09:59:06 +0200
commit2e4ccd3d34dedc136dd4d0976705c690c63ffd73 (patch)
tree3609452da0aa0e63edbe32238af19a92a86113c3 /create/content_test.go
parentfd924d1802cb9c20c2617b1c72dac6bc36560d61 (diff)
create: Preserve shortcodes in archetype templates
Fixes #3623
Diffstat (limited to 'create/content_test.go')
-rw-r--r--create/content_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/create/content_test.go b/create/content_test.go
index bd7c34a1d..914759164 100644
--- a/create/content_test.go
+++ b/create/content_test.go
@@ -49,6 +49,11 @@ func TestNewContent(t *testing.T) {
{"stump", "stump/sample-2.md", []string{`title: "Sample 2"`}}, // no archetype file
{"", "sample-3.md", []string{`title: "Sample 3"`}}, // no archetype
{"product", "product/sample-4.md", []string{`title = "SAMPLE-4"`}}, // empty archetype front matter
+ {"shortcodes", "shortcodes/go.md", []string{
+ `title = "GO"`,
+ "{{< myshortcode >}}",
+ "{{% myshortcode %}}",
+ "{{</* comment */>}}\n{{%/* comment */%}}"}}, // shortcodes
}
for _, c := range cases {
@@ -126,6 +131,24 @@ title = "{{ .BaseFileName | upper }}"
path: filepath.Join("archetypes", "emptydate.md"),
content: "+++\ndate =\"\"\ntitle = \"Empty Date Arch title\"\ntest = \"test1\"\n+++\n",
},
+ // #3623x
+ {
+ path: filepath.Join("archetypes", "shortcodes.md"),
+ content: `+++
+title = "{{ .BaseFileName | upper }}"
++++
+
+{{< myshortcode >}}
+
+Some text.
+
+{{% myshortcode %}}
+{{</* comment */>}}
+{{%/* comment */%}}
+
+
+`,
+ },
} {
f, err := fs.Source.Create(v.path)
if err != nil {