# Creating AMP Equivalents

**URL:** <https://discourse.gohugo.io/t/creating-amp-equivalents/8383>\
**Category:** support\
**Created:** [September 14, 2017, 4:21pm UTC](https://discourse.gohugo.io/t/creating-amp-equivalents/8383 "2017-09-14T16:21:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vidya](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/vidya/32/3997_2.png) [@vidya](https://discourse.gohugo.io/u/vidya)\
**Post date:** [September 14, 2017, 4:21pm UTC](https://discourse.gohugo.io/t/creating-amp-equivalents/8383/1 "2017-09-14T16:21:15Z")

</div>

I have a production website up and running, and I thought I would play around with Hugo’s AMP support. I added this to my `config.toml`:

```
[outputs]
  home = ["HTML", "AMP"]
  page = ["HTML", "AMP"]
  blog = ["HTML", "AMP"]
  course = ["HTML", "AMP"]
  tutorial = ["HTML", "AMP"]

```

Where the latter two are custom archetypes.

When I run the server, I go to `/amp` (_i.e._ what I educated guessed from the documentation is the AMP equivalent of the home page), and I see my home page. But this home page does not have any AMP markup. Meanwhile, I am unable to find any AMP pages for my other content, and I have tried putting `/amp`/ pretty much everywhere along the paths.

Clearly I am missing something in my configuration. The documentation is very clear on how to add new formats and customize existing formats, but I am lost on simply seeing what I have out of the box for AMP support.

Any guidance is appreciated.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [September 14, 2017, 8:45pm UTC](https://discourse.gohugo.io/t/creating-amp-equivalents/8383/2 "2017-09-14T20:45:51Z")

</div>

So, Hugo supports multiple output formats, but the templates must be provided by you or the theme. That you see non-amp-markup on homepage means that it has html as a fallback layout. Try to put a layout in /layouts/index.amp.html.

Also, your outputs definition is partly wrong. It should be one definition per Page kind (see the doc).

---

<div class="post-metadata">

**Author:** ![vidya](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/vidya/32/3997_2.png) [@vidya](https://discourse.gohugo.io/u/vidya)\
**Post date:** [September 14, 2017, 10:30pm UTC](https://discourse.gohugo.io/t/creating-amp-equivalents/8383/3 "2017-09-14T22:30:47Z")

</div>

Initially I assumed that there might be some function that takes generated conventional HTML and produces an AMPed-up HTML equivalent. After I observed what happened, I started to figure that I need an AMP layout. Thanks for confirming.

I’m a bit confused on your second point and by the doc regarding “one definition per Page kind.” It’s a matter of semantics. I assumed “page kind” in my example would be `tutorial` or `blog` or `home`. Given that, there _is_ only one definition per page kind–_i.e._ one array albeit with multiple elements. The doc has this example: `home = ["HTML", "AMP", "RSS"]`.

Obviously, my mental model is wrong. Please clarify when you get a chance. Thanks.

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [September 14, 2017, 10:59pm UTC](https://discourse.gohugo.io/t/creating-amp-equivalents/8383/4 "2017-09-14T22:59:35Z")

</div>

See the docs at [output formats for pages](https://gohugo.io/templates/output-formats/#output-formats-for-pages):

> The output definition is per Page Kind (i.e, page, home, section, taxonomy, or taxonomyTerm).

So your config would look more like:

```toml
[outputs]
  home = ["HTML", "AMP"]
  page = ["HTML", "AMP"]

```

You could add taxonomy there, if for instance that is what a “course” is. Also, I’d consider adding RSS to those; feeds are super friendly to web folks. 🙂

---

<div class="post-metadata">

**Author:** ![vidya](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/vidya/32/3997_2.png) [@vidya](https://discourse.gohugo.io/u/vidya)\
**Post date:** [September 15, 2017, 1:09am UTC](https://discourse.gohugo.io/t/creating-amp-equivalents/8383/5 "2017-09-15T01:09:34Z")

</div>

Isn’t that declarative syntax exactly what I did?

I had already read the documentation, but as I said earlier, the disconnect is in my interpretation of what it says vs the intent.

Anyway, I have AMP equivalents of my pages deployed live now. Thanks for the help.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [September 15, 2017, 5:01am UTC](https://discourse.gohugo.io/t/creating-amp-equivalents/8383/6 "2017-09-15T05:01:23Z")

</div>

> [@vidya](#):
>
> Isn’t that declarative syntax exactly what I did?

No, it isn’t. Compare yours and his version and you will find that they are note **exactly** the same.
