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 you will see in head section <link rel="amphtml" href="">.
Does someone know how to add this tag to /home and /tag pages?

@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"}}}
<!-- 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