-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Description
Reference: https://discourse.gohugo.io/t/shortcode-for-iframe-breaking-at-update-hugo-122-x-123-8/48904
Not sure if this is an enhancement or a bug.
The test below obviously passes with v0.122.0 because we blindly copied content page resources (.html, .htm, .adoc, .pdc, .org, .rst, .md) when publishing the site.
By design we are no longer copying content page resources, but I think site and theme authors should be able to publish them with Permalink, RelPermalink, and Publish.
Failing test:
func TestFoo(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
baseURL = 'https://example.org/'
disableKinds = ['home','rss','section','sitemap','taxonomy','term']
-- content/p1/index.md --
---
title: p1
---
-- content/p1/a.html --
<p>a</p>
-- content/p1/b.html --
<p>b</p>
-- content/p1/c.html --
<p>c</p>
-- layouts/_default/single.html --
|{{ (.Resources.Get "a.html").RelPermalink -}}
|{{ (.Resources.Get "b.html").Permalink -}}
|{{ (.Resources.Get "c.html").Publish }}
`
b := hugolib.Test(t, files)
b.AssertFileContent("public/p1/index.html", "|/p1/a.html|https://example.org/p1/b.html|")
b.AssertFileContent("public/p1/a.html", "<p>a</p>")
b.AssertFileContent("public/p1/b.html", "<p>b</p>")
b.AssertFileContent("public/p1/c.html", "<p>c</p>")
}The workaround is a bit ugly:
{{ ((.Resources.Get "a.html").Content | resources.FromString "/p1/a.html").RelPermalink }}
{{ ((.Resources.Get "b.html").Content | resources.FromString "/p1/b.html").Permalink }}
{{ ((.Resources.Get "c.html").Content | resources.FromString "/p1/c.html").Publish }}
cmahnke and irkode