mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 13:40:38 +03:00
parent
fd924d1802
commit
2e4ccd3d34
2 changed files with 43 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue