-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Output format (AMP) render hooks aren't getting used #7160
Comments
I am also running into this issue
|
Hmm... |
Bumped into this issue while enabling AMP alternative output for my theme. |
I discovered that this issue #7434 is related. When I explicitly saved my Please let me know how to further investigate (or close the other ticket if it is considered duplicated). |
Please test again with 0.74. I suspect this was resolved with #7455. |
Test results with Direct run with
|
Just for information in the case this issue is fixed and may need for specific test. When the page with output format AMP using shortcodes "youtube.amp.html" and "render-image.amp.html" together Example content: ![](image.jpg)
{{< youtube w7Ft2ymGmfc >}} The output format AMP will get the result correctly and issue #7160 is gone. but if there is a image without shortcodes, Example content: ![](image.jpg) it will hit the issue #7160 . |
@bep , double confirmation:
If item 2 is not clear, I may drop the AMP implementations entirely from the theme module since the multiple output is not functioning properly at build level. =( |
This issue is not specific as AMP format, But it affect all format related with Custom Output Formats Feature. Example config for Custom Output Formats: [outputFormats]
[outputFormats.AppFormat]
baseName = "index"
name = "app"
isPlainText = false
mediaType = "text/html"
isHTML = true
permalinkable = true
noUgly = false
path = "app"
[outputs]
section = ["HTML", "APP"]
page = ["HTML", "APP"] Creating render hooks at |
I tried to look at AMP output as well and can confirm that when page got YouTube iframe and However its not fully up to that. Without |
Some investigation update hopefully can help: When I use
This indicates that Hugo fails to identify its multiple outputs format where it is supposed to list all other formats except AMP itself. While the
Still no chance to find a working workaround since Hugo does not dump any additional user-level information like full request URL (forum URL: https://discourse.gohugo.io/t/how-to-get-requests-url-as-it-is/29392). EDIT:
|
I did not see maintainer activity on this issue, so I belive this issue will not be fixed soon(or never be fixed). Then I created a new fork https://github.com/neohugo/neohugo, may be you could try. but it migth break the compatible with the hugo too. it contains fixes related AMP and also optimize memory and maybe faster for large website building. |
I thought of forking out the source code but it can be burdening for the long run. At the moment, @bep and his team is working on debugging the recently added npm packages feature. I do not mind the wait. I do hope maintainers can provide some attention to this issue as multiple outputs feature is completely blocked without workaround from theme developer POV. There is no way to go around permalink or getting a pure request URL for shortcode. Prehaps can you upstream you workaround fixes for him to review? |
It is probably somehow appreciated that you spend some time and implement changes in relation to this issue. I think, instead of forking Hugo is not a great idea for day-to-day use. For testing in finding a solution, yes. I think @bep and his team would be appreciated if you will rather share your finding and solution to this issue so they can implement this to the main batch. This issue is not on somehow high priority, but every help counts. |
@idarek, are you familiar with the source code specifically at process mapping for shortcode? I do have strong Go background but I need a code navigator as a lighthouse. The repository is large and it will take some times for me just to understand how things work before fixing any bugs. |
Sorry but no. Not a developer but a more rather self-taught person. Can support in testing etc. |
You may take a look at PRs that I have been submit or other PR #3934 which is important feature first. |
Fixed with #8310. Please close. |
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. |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes, CI pipeline is running
Expected Behavior
An
<amp-img>
would appear on the page as given inrender-image.amp.html
Actual Behavior
An
<img>
appears on the page using the template inrender-image.html
Misc.
Code: https://github.com/ct-martin/food/ (note that theme is a git submodule)
Forum thread: https://discourse.gohugo.io/t/markdown-render-hook-image-for-amp-template-not-working/23525/
The text was updated successfully, but these errors were encountered: