-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
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:
- https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html
- https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html
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: