Skip to content

Rename config option for embedded renderhooks to useEmbedded ({never,always,fallback}) #13535

@jmooring

Description

@jmooring

Example

Let's say that a theme provides image and link render hooks that are not compatible with multilingual single-host sites. Enabling the embedded image and link render hooks in the config does nothing, as designed:

[markup.goldmark.renderHooks.image]
enableDefault = true

[markup.goldmark.renderHooks.link]
enableDefault = true

Today, site authors have to override the theme's files in the usual fashion, copying code from:

Proposal

Provide a config option to ALWAYS use the embedded hook, overriding those provided by themes, modules, and in the project root. For example:

[markup.goldmark.renderHooks.image]
enableDefault = true
override = true

[markup.goldmark.renderHooks.link]
enableDefault = true
override = true

I'm not in love with the option name. Some alternatives:

defaultOverridesAll (yuck)
forceDefault
overrideWithDefault

In addition to the example above, perhaps the most common reason to enable the embedded image and link render hooks is to handle sites that are served from subdirectories (e.g., the majority of GitHub Pages sites). This came up again today:

https://discourse.gohugo.io/t/cant-get-images-working-on-github-pages/54120

Other forum topics where this would have helped:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions