# Different outputs with the same media type in Hugo

**URL:** <https://discourse.gohugo.io/t/different-outputs-with-the-same-media-type-in-hugo/12366>\
**Category:** support\
**Created:** [June 11, 2018, 2:44pm UTC](https://discourse.gohugo.io/t/different-outputs-with-the-same-media-type-in-hugo/12366 "2018-06-11T14:44:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamezrin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jamezrin/32/6204_2.png) [@jamezrin](https://discourse.gohugo.io/u/jamezrin)\
**Post date:** [June 11, 2018, 2:44pm UTC](https://discourse.gohugo.io/t/different-outputs-with-the-same-media-type-in-hugo/12366/1 "2018-06-11T14:44:24Z")

</div>

I have got this issue and thought about posting it here too.

> <https://stackoverflow.com/questions/50799843/different-outputs-with-the-same-media-type-in-hugo>

In my hugo site I need to serve an index file that is generated from a template called `index.json`. I also need to generate another file from a template called `lastmod.json`

So, following the documentation I came up with this config, which does not work. When accessing `lastmod.json` instead of giving me the content of its template, the content of the first template is rendered instead.

```auto
[outputFormats.JSON-index]
    baseName = "index"
    isPlainText = true
    mediaType = "application/json"
    notAlternative = true

[outputFormats.JSON-lastmod]
    baseName = "lastmod"
    isPlainText = true
    mediaType = "application/json"
    notAlternative = true

```

What this leads me to believe is that you can only create one output format for every mediaType because if I use this configuration it works without any problems. But I wanted to have both files with the json extension.

```auto
[outputFormats.JSON-index]
    baseName = "index"
    isPlainText = true
    mediaType = "application/json"
    notAlternative = true

[outputFormats.JSON-lastmod]
    baseName = "index"
    isPlainText = true
    mediaType = "application/lastmod"
    notAlternative = true

[mediaTypes]
    [mediaTypes."application/lastmod"]
        suffix = "lastmod"

```

Is it possible to make both files end in .json? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![jamezrin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jamezrin/32/6204_2.png) [@jamezrin](https://discourse.gohugo.io/u/jamezrin)\
**Post date:** [June 12, 2018, 10:40am UTC](https://discourse.gohugo.io/t/different-outputs-with-the-same-media-type-in-hugo/12366/2 "2018-06-12T10:40:31Z")

</div>

Bump!

---

<div class="post-metadata">

**Author:** ![Jura](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jura/32/13581_2.png) [@Jura](https://discourse.gohugo.io/u/Jura)\
**Post date:** [June 15, 2018, 4:02pm UTC](https://discourse.gohugo.io/t/different-outputs-with-the-same-media-type-in-hugo/12366/3 "2018-06-15T16:02:19Z")

</div>

> [@jamezrin](#):
>
> Is it possible to make both files end in .json?

I simply set the `url` variable in the front matter of the custom outputs for that:

```auto
+++
outputs = ["SectionRSS"]
url = "/platform/rss.xml"
layout = "section-rss"
+++

```

I never succeeded in doing it another way from what I can recall, so also unfortunately can’t help much more with the approach you’re trying here.
