Add rel="amphtml" into /home, /tag/example pages

We have an AMP version for the home blog page and tag pages. If you look at the post page https://www.littlelunch.de/magazin/wochenplan/ you will see in head section <link rel="amphtml" href="https://www.littlelunch.de/magazin/wochenplan/amp/">.
Does someone know how to add this tag to /home and /tag pages?

https://www.littlelunch.de/magazin/
https://www.littlelunch.de/magazin/amp
https://www.littlelunch.de/magazin/tag/suppe/
https://www.littlelunch.de/magazin/tag/suppe/amp/

@DavidDarnes I will appreciate it if you have some updates. Thanks!

Hey @shystruk :wave:
You can add them in by editing the template used for them and using the block / contentFor helper. Something like the following would work:

  <!-- in your default.hbs file -->
  {{{block "amplink"}}}
</head>
<!-- in your template files. e.g. index.hbs, tag.hbs… -->
{{#contentFor "amplink"}}<link rel="amphtml" href="{{@site.url}}{{page_url}}amp/">{{/contentFor}}

More info on this syntax can be found here:

Hope this helps!

1 Like

Thanks. It works.
Small corrections in url href="{{@site.url}}{{page_url}}amp/"

1 Like

Ah thanks for catching that, I’ve updated my original post