-
Notifications
You must be signed in to change notification settings - Fork 800
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
Enable related posts for AMP #13028
Enable related posts for AMP #13028
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: August 6, 2019. |
gravityrail, Your synced wpcom patch D30356-code has been updated. |
gravityrail, Your synced wpcom patch D30356-code has been updated. |
I enabled: Rendering as: When thumbnails are hidden: With heading hidden (with social sharing icons included above to show spacing): It looks good, except for the thumbnails being a bit off. |
gravityrail, Your synced wpcom patch D30356-code has been updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - only change needed is the $enqueue_script
logic.
@@ -235,7 +258,7 @@ public function get_target_html() { | |||
* | |||
* @returns string | |||
*/ | |||
public function get_target_html_unsupported() { | |||
public function get_client_rendered_html_unsupported() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably out of scope of this PR, but is Related Posts supposed to appear in the loop? The doc comment implies not, but I'm seeing them on a test homepage (both on this branch and master
).
Co-Authored-By: Jefferson Rabb <jefferson.rabb@automattic.com>
gravityrail, Your synced wpcom patch D30356-code has been updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Added to 7.6 milestone as per request of @gravityrail |
gravityrail, Your synced wpcom patch D30356-code has been updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me, although the whole section looks pretty bad without any CSS. I don't know if we should ship this change now, without applying basic styles to the related posts.
Fixes #9556
Currently the related posts block is disabled for all AMP requests because they don't support client-side JS. However, the Gutenberg block does server side rendering. This patch reuses the Gutenberg code in kind of a brute-force way to enable Related Posts in AMP.
cc @westonruter @jeffersonrabb
Changes proposed in this Pull Request:
Is this a new feature or does it add/remove features to an existing part of Jetpack?
Testing instructions:
This is the most minimal, brute-force version I could create. It may create invalid AMP in other ways (e.g. too much CSS). Comments and corrections welcome.
Proposed changelog entry for your changes: