Jetpack: Port Related Posts to work with AMP

Created on 15 May 2018  Â·  6Comments  Â·  Source: Automattic/jetpack

In https://github.com/Automattic/jetpack/pull/9458 we propose disabling Related Posts as it is broken on AMP sites, primarily due to the reliance on javascript to load the related posts from WPCOM.

This issue was created to track making this features work with AMP.

A fix would be to load, cache and render the related posts area server-side.

AMP Related Posts [Type] Enhancement

Most helpful comment

I tweeted about this in September but I neglected to comment on this issue: I made a compatibility plugin to a subset of get Related Posts to work work in AMP.

You can see it live on this AMP page: https://make.xwp.co/2018/12/01/amp-plugin-release-v1-0-rc4/?amp

image

Here's the gist that shims AMP support into Jetpack: https://gist.github.com/westonruter/1515ce1bae788e6d52d1a94ddd61fb59

The amount of code would be less if integrated straight into the Related Posts module.

Also, this code assumes AMP pages being served in paired/native modes. Additional logic would be needed for classic mode.

All 6 comments

I think this needs the AMP Support label.

This issue has been marked as stale. This happened because:

  • It has been inactive in the past 6 months.
  • It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.

No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.

I tweeted about this in September but I neglected to comment on this issue: I made a compatibility plugin to a subset of get Related Posts to work work in AMP.

You can see it live on this AMP page: https://make.xwp.co/2018/12/01/amp-plugin-release-v1-0-rc4/?amp

image

Here's the gist that shims AMP support into Jetpack: https://gist.github.com/westonruter/1515ce1bae788e6d52d1a94ddd61fb59

The amount of code would be less if integrated straight into the Related Posts module.

Also, this code assumes AMP pages being served in paired/native modes. Additional logic would be needed for classic mode.

2133418-zen

2169258-zen

@westonruter any chance you could review this? https://github.com/Automattic/jetpack/pull/13028

Was this page helpful?
0 / 5 - 0 ratings