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

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

[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.

layouts

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

  docs                # from docs module
    list.html
    single.html
    index.html
+++
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.