-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way to identify a non-Page HTML etc. resource #12274
Comments
|
Understood. Is there something cleaner than this to just dump the file (and return Permalink/RelPermalink)?
Or this?
|
... 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 |
Related to #9197. |
just thinking out loud: Using .Page.Resource with a page bundle
both have a ResourceType of page but you may only call .Permalink on the latter one So at least within the templating there's a different experience incl. inconsistency for users. According to the Docs looks like there is some Go magic interfacing behind ... and somehow obfuscating the details... Summary: maybe thinking a bit easy ;-) If a page source file is processed by a Template its a "Page" If a Resource is published - the Content is copied verbatim to the target file |
This is essentially a critical issue for us, and has caused us to stop updating Hugo at 122. We have hundreds of html files that are treated as page resources (in our case, these are generated plotly graphs). And, then included in iframes for rendering. Changing the extension just doesn't work since then the files don't render. Putting everything in the static folder is really not a good solution for us, since we are trying to keep the graphs local with the data they are relative to. For us, even just turning off or controlling the extensions that are treated as pages would be enough, we don't have html files as content anywhere. |
@Whoome In case you aren't aware of this...
Putting the above in a single.html file will publish the HTML files. |
No I wasn't aware of that. I just need to drop that anywhere in the theme? |
Whichever one renders the pages with the HTML resources. |
This is an empty struct for now, but we will most likely expand on that. ``` [[contentTypes]] [[contentTypes."text/markdown"]] ``` The above means that only Markdown will be considered a content type. E.g. HTML will be treated as plain text. Fixes gohugoio#12274
This is an empty struct for now, but we will most likely expand on that. ``` [[contentTypes]] [[contentTypes."text/markdown"]] ``` The above means that only Markdown will be considered a content type. E.g. HTML will be treated as plain text. Fixes gohugoio#12274
This is an empty struct for now, but we will most likely expand on that. ``` [[contentTypes]] [[contentTypes."text/markdown"]] ``` The above means that only Markdown will be considered a content type. E.g. HTML will be treated as plain text. Fixes gohugoio#12274
This is an empty struct for now, but we will most likely expand on that. ``` [[contentTypes]] [[contentTypes."text/markdown"]] ``` The above means that only Markdown will be considered a content type. E.g. HTML will be treated as plain text. Fixes gohugoio#12274
This is an empty struct for now, but we will most likely expand on that. ``` [contentTypes] [contentTypes.'text/markdown'] ``` The above means that only Markdown will be considered a content type. E.g. HTML will be treated as plain text. Fixes gohugoio#12274
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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:
The text was updated successfully, but these errors were encountered: