Allow AMP format request from API


#1

I believe this may be under development already but creating this topic to track progress. It would be great if we could pull the AMP formatted markdown from the API for use in an external site.


#2

For a page to be AMP-compatible there’s more than just the post body HTML that needs to be “AMPerized” - you can see this in practice with the {{amp_ghost_head}} and {{amp_components}} helpers in the default amp.hbs template. Providing an AMPerized content field on the API wouldn’t solve the problem of trying to use it in an external site.

Can you share your use-case where you have an external site but are unable to use an AMP converter on your full page content?


#3

Making sure everything but the post content is AMP compatible would of course be the responsibility of the developer of the external site.

However, if we work under the assumption that the non ghost pieces are ready to go then it would make life much easier if we could request the content that has been put through the ampContent function here:
https://github.com/TryGhost/Ghost/blob/master/core/server/apps/amp/lib/helpers/amp_content.js rather than having to create our own AMP conversion function.

The use case is that we already have an AMP layout used for other parts of the site and would just like to inject the AMP content of the post into that layout.