Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Apr 12, 2019
1 parent 9e9a1f9 commit 4d425a8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions hugolib/shortcode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,37 @@ C-%s`

}

// https://github.com/gohugoio/hugo/issues/5833
func TestShortcodeParentResources(t *testing.T) {
t.Parallel()

b := newTestSitesBuilder(t).WithSimpleConfigFile()
b.WithTemplatesAdded("shortcodes/c.html", `
{{ range .Page.Parent.Resources }}
* {{ .Name }}: {{ .RelPermalink }}
{{ end }}
`)

b.WithContent("b1/index.md", `
---
title: MyPage
---
{{< c >}}
`,
"b1/logo.png", "PNG logo",
)

b.Build(BuildCfg{})

b.AssertFileContent("public/index.html",
"List Content: <p>Logo:P1:|P2:logo.png/PNG logo|:P1: P1:|P2:docs1p1/<p>C-s1p1</p>\n|",
"BP1:P1:|P2:docbp1/<p>C-bp1</p>",
)

}

func TestShortcodePreserveOrder(t *testing.T) {
t.Parallel()
assert := require.New(t)
Expand Down

0 comments on commit 4d425a8

Please sign in to comment.