How to create parallel AMP (accelerated mobile pages) for posts?

Hello,

Hope you all are doing well. I am building hugo web pages based on this theme below:

What I want is to have 2 versions of the same webpage: one with the regular theme and the other as an accelerated mobile page.

I am not sure how to achieve that. Forgive me for my inexperience but I have tried creating single.amp.html, but that doesn’t work.

Also, how would I view the amp pages on localhost? I just need to view them so I know they exist.

Also, another thought in my head revolves around if I should create a parallel AMP website or just parallel AMP webpages.

Please guide.

EDIT: Found the solution to the above questions.

Few more questions though:

  • The img tag is preserved, but AMP requires amp-img tag. Any pointers on how to get img for regular pages while amp-img for amp pages?
  • Any pointers around the AMP website vs Single AMP pages would still help though.

Thanks,
Ayan

EDIT: Found the solution:

  • I missed enabling the option in config. Reference = Custom Output Formats | Hugo
  • The single.amp.html works now :slight_smile:
  • Found the amp file location as well : localhost:xxxx/amp(/dir1/post1)

Thanks

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.