-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lookup render hook templates by output format, falling back to HTML if present #13242
Comments
I've encountered this before, and had to create one for HTML and one for the other output format. This is true for all render hooks, and I understand why. Today, if you have three output formats and you want to modify the rendering of links (for example) for all output formats in the same way, you only need to create one render hook instead of creating three identical render hooks. Maybe we should treat HTML as Hugo's default output format1. If there's not a hook targeting the current output format, use the HTML hook if present, else no hook at all. This would be a breaking change, but it wouldn't affect many (any?) users. In the above, the "HTML hook if present" bit is also true when we're using default render hooks. Or we could fall back to something like render-link.default.irrelevant. But this would be a much larger breaking change. Footnotes
|
When you add the blockquote render hook "render-blockquote.rss" and don't provide "render-blockquote.html", HTML rendering changes: "render-blockquote.rss" replaces the default HTML blockquote rendering. I assumed it would only affect RSS and it messed up my site. IMO this is counterintuitive.
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes.
The text was updated successfully, but these errors were encountered: