Partials Not Working For Output Formats

Hi, i created a output format named “instant” and 2 partials

test.html.html and test.instant.html

It always use test.html.html

I tried:

test.html + test.instant.html
test + test.instant

They did not work too


Not sure what you mean by “not working” here.

The partial func takes a partial name. So {{ partial "test.instant.html" }} should give you that partial. Are you saying that isn’t true?

If no to the above, you give too little information. A non-working project would be good.

Sorry, i will try to explain myself better.

I have a blog with hugo where i use a AMP theme, and i use some shortcodes that add amp elements to my page, like amp-img.
Now i’m trying to use the new feature output formats to output my page in a way that Facebook Instant Article can understand.

I created a custom output format

[outputFormats.INSTANT] name = "instant" mediaType = "text/html" path="instant" rel = "instant" isPlainText = false isHTML = true NoUgly = false NotAlternative = false

and in the most parts it is working where well.

My problem is that a have a shortcode that adds the in instead of
So i have to customize this shortcode.

There is no page variable that inform which output format that i’m acessing, so the way that a i find was to use partial. Acording with the output format docs

All of the above examples can also include partials.


Hugo will now also detect the media type and output format of partials, if possible, and use that information to decide if the partial should be parsed as a plain text template or not.

Hugo will look for the name given, so you can name it whatever you want. But if you want it treated as plain text, you should use the file suffix and, if needed, the name of the Output Format ([partial name].[OutputFormat].[suffix]).

Soo i tried

to create the partials

  • test.html.html and test.instant.html
  • test.html + test.instant.html
  • test.html + test.instant.html

and call it like

  • {{partials “test” }}
  • {{partials “test.html” }}
    but it never use the outputformat customized one, just the default

if a use {{partials “test.instant.html” }} it shows that one, but it don’t solve my problem.

Thanks for the attention.
Sorry if i was not clear before

I think I understand:

  • Partials are dumb when it comes to “output formats” (Hugo uses the extension to determine text or HTML parsing, but that is another story)
  • This is not a problem inside regular templates (in fact, it makes it plenty flexible).
  • For shortcodes, see – this issue is in progress and will give a solution to the AMP “amp-img” etc.

I see.
I will wait for the shortcode implementation.

Thank you very much