# What's the right way to avoid creating duplicate custom format's template on the case of \`type\` set

**URL:** <https://discourse.gohugo.io/t/whats-the-right-way-to-avoid-creating-duplicate-custom-formats-template-on-the-case-of-type-set/42052>\
**Category:** support\
**Created:** [December 23, 2022, 12:12pm UTC](https://discourse.gohugo.io/t/whats-the-right-way-to-avoid-creating-duplicate-custom-formats-template-on-the-case-of-type-set/42052 "2022-12-23T12:12:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![razon](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/razon/32/14882_2.png) [@razon](https://discourse.gohugo.io/u/razon)\
**Post date:** [December 23, 2022, 12:12pm UTC](https://discourse.gohugo.io/t/whats-the-right-way-to-avoid-creating-duplicate-custom-formats-template-on-the-case-of-type-set/42052/1 "2022-12-23T12:12:24Z")

</div>

Hi, I’m trying to customize an output format called `offline`, which provide a built-in UI (template `_default/index.offline.html`).

```toml
[outputFormats]
[outputFormats.Offline]
name = "Offline"
baseName = "offline"
isHTML = true
notAlternative = true
mediaType = "text/html"

[outputs]
home = ["HTML", "RSS", "Offline"]

```

But there’ll be a problem if `type` presents in `content/_index.md`.

> Assume there are multiple layouts modules for home page, such as `blog` and `docs`, users can specify their home page to one of them via `type`.

```auto
layouts

  blog # from blog module
    list.html
    single.html
    index.html

  docs # from docs module
    list.html
    single.html
    index.html

```

```toml
+++
type = "blog"
+++

```

According to the look-up order, the `offline` page will be rendered as the same as the type’s `index.html`, I have to create the `index.offline.html` each types, `layouts/blog/index.offline.html` and `layouts/docs/index.offline.html`.

What’s the proper way to avoid this? Thanks.

I tried to define a custom media type, but the offline page won’t be rendered as HTML by browser since the content type isn’t `text/html`, so I think this may be a wrong way.

I save the template as partial, and then include them on all `index.offline.html` templates for now, I’m wondering if there will be a much better solution that without creating _extra_ `index.offline.html`.
