There is one post that is marked as members-only: Mein Studio für Remote-Trainings
My template is written such that (for non-members) it shows a sign-in box below the excerpt of that article.
I published a link to that post on Twitter. When I tap on the tweet in Twitter on my iPhone 11, the featured image is shown but the body of the article is not. I found out that Twitter is not the problem – it is simply trying to show the AMP version of the post! See this: Mein Studio für Remote-Trainings – the body of the post is empty!
My question: Do I need to write a custom amp.hbs file for my site to fix this? What do I need to write into it if it is to show members only content, depending on who is logged in or not?
Correct - but IMO that would be the most complicated route and it might not provide much extra benefit. It depends on how important AMP is for the rest of your content?
For example:
Option 1: If most of your site content is Public and you benefit from having AMP turned on, then personally I’d use manual redirects for any Members only content to ensure people always land on the non-AMP version of those pages.
Option 2: If most of your site content is Members only - I’d probably turn AMP off entirely. The whole point of AMP is to provide a faster mobile experience for public content. It’s not really that useful for accessing content that is protected.
Option 3: You could still update your amp.hbs if you prefer, and use placeholder content that contains a link to your subscribe page, but this is definitely more complicated and might just cause extra friction, compared to sending people directly to the non-AMP page :)
Of course it’s entirely your decision. This is my two-cents!