Open jmooring opened 7 months ago
Page
(no RelPermalink
); this is how it have always behaved.Page
has no Publish
method for good reason: A page can have shortcodes, can be rendered to multiple output formats, so the rendering/publishing needs to be coordinated.Understood. Is there something cleaner than this to just dump the file (and return Permalink/RelPermalink)?
{{ ((.Resources.Get "a.html").Content | resources.FromString "/p1/a.html").RelPermalink }}
Or this?
{{ with .Resources.Get "a.html" }}
{{ (.Content | resources.FromString .Path).RelPermalink }}
{{ end }}
Is there something cleaner than this to just dump the file (and return Permalink/RelPermalink)?
... copy it into ... static?
OP's use case needs to organize these with the page. I'm recommending second example above, or renaming the resource (e.g., a.txt instead of a.htm).
I have reopened and relabeled this ... I don't know how to practically do this, but it would be a good idea if we had a way to say that a particular bundled (e.g. HTML) file should be handled as a regular simple resource with a mime type (as in: not a Page
).
Related to https://github.com/gohugoio/hugo/issues/9197.
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
, andPublish
.Failing test:
The workaround is a bit ugly: