AMP redirected to the non AMP with Hugo

Hi all,
I have AMP (accelerated mobile pages) available on my HUGO project but they are not visible on Netlify (goofy-curran-ccbfc3.netlify.com).
Actually they are redirected to the non AMP pages.
Has anyone find this before?

hmm, I haven’t actually encountered this before. Do you have some more information on AMP and how it works? thanks.

For
http://localhost:1313/page/
Hugo is generating the page under “amp” folder and I declare the link to that page in the non Amp equivalent in head like this:
<link rel="amphtml" href='http://localhost:1313/amp/page/' hreflang="en-GB" />
Then google is taking that page on the server and shows it on search results.

On local I can navigate to that page but making a deploy on Netlify I notice that there is a redirect or something that makes the /amp/ folder to looks exactly the same as the route.

Hmm, i am not sure and unfortunately nobody here on the support team has a clear answer for you.

You might ask in the hugo support forums:

if you get a response or a fix, it would be fantastic if we could learn from you, so we hope you’ll come back and tell us!

Update Hugo version from 0.58.1 to 0.66.0 made my day.

1 Like

Hi,
I find out that in amp-boilerplate some spaces are removed and that makes my site to fail amp validation - please se the code (every space before “0” and after “)” is removed):
Original
<style amp-boilerplate="">body{-webkit-animation:-amp-start 8s steps(1,end) 0s
Netlify deploy
<style amp-boilerplate="">body{-webkit-animation:-amp-start 8s steps(1,end)0s

Do you know why?

hi @solopx - unfortunately I don’t. Did you ask in the Hugo Community that I suggested above? They might have more advice at this time.

@perry
Unfortunately is a matter of how Netlify is optimising the files.
Is there a way to stop minimise the html files from “amp” folder?

hi @solopx, you can definitely switch off asset optimization, either in the UI or file file based configuration:

or