Front matter override for Goldmark

According to the docs (Front matter | Hugo)

It’s possible to set some options for Markdown rendering in a content’s front matter as an override to the BlackFriday rendering options set in your project configuration.

Assuming this also applies to the current default renderer (Goldmark), what magic incantations do I need to put in my page front matter to enable hardWraps?

I’ve tried:

markup:
  goldmark:
    renderer:
      hardWraps: true

goldmark:
    renderer:
      hardWraps: true

renderer:
      hardWraps: true

goldmark:
      hardWraps: true

hardWraps: true

but none seem to work.

1 Like

The options are at https://gohugo.io/getting-started/configuration-markup#goldmark

One of your examples looks correct. Double-check spacing, etc.

That’s where I got the information from in the first place.

Thanks for not telling which one :disappointed:.
AFAICS none of them seem to work.

Take e.g. smartypants. For BlackFriday it is:

blackFriday:
  smartypants: false

so for Goldmark this would be:

goldmark:
  extensions:
      typographer: false

But no… so I must assume the documentation is actually correct:

It’s possible to set some options for Markdown rendering in a content’s front matter as an override to the BlackFriday rendering options set in your project configuration.

It works for BlackFriday, it doesn’t work for Goldmark.

1 Like

I’ve updated the topic title.

The first question to answer: does Goldmark allow front matter overrides? If so, we can update the docs to reflect that and explain. If not, we can remove that block referencing BlackFriday overrides from the doc.

If not, we can update the docs by adding that this works for BlackFriday only.

1 Like