Handlebars not parsed


I’m trying to adjust the size of an image with code between handlebars but this code is not parsed/processed and then code with handlebars appears as is in the html.

I also tried with this code {{ .PublishDate.Format “January 2, 2006” }}, grabbed in the documentation, but it also appears as a text (between

tags) in the html.

I can’t find information about that can someone help me ?


Please show your code. Literal descriptions without it don’t help. (I don’t even know what you mean with “handlebars”).

Montre le code, stp. Si non, on ne peut pas t’aider.

That’s a misundestanding. I tried to use {{ }} in the markdown file.

I’m discovering it’s only possible in the layouts files.



That’s why I asked you to show your code.

The issue is not with {{…}} in your Markdown file, but what these curly braces contain.

  • In the form of {{%…%}} or {{<...>}}, they are used to call a shortcode, which is perfectly fine in Markdown, and Hugo contains some pre-defined shortcodes.
  • Without the % signs, they are used to executing template code, and that is only possible in … well, templates, aka HTML files.

In Hugo parlance, layouts is a directory, the files are templates. Shortcodes etc. are detailed in the documentation.

Thanks for the more accurate explanation. I see better how the engine works.

I’ve thought it was working a bit like jsp/php … and so be able to code in the content files, pushing to later templating.

Nice design which forces to be “clean” up front.

Fortunately not :wink: The most important difference being that you get static HTML, Hugo doesn’t bother with runtime stuff.