-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Add IsBlock to the image render hook context #10494
Comments
This is nice, can we also do it for render link? My usage is i want paragraph that contains only a link to render block element. Hello world
[Hugo Video](https://youtu.be/0RKpf3rK57I)
Hello World
The link will render youtube embedded iframe. |
bep
added a commit
to bep/hugo
that referenced
this issue
Dec 4, 2022
* Removes any surrounding paragraph nodes * And transfers any attributes from the surrounding paragraph down to the image node * Adds a new IsBlock field to the link context passed to the render hooks, only set for images. IsBlock is set to true if the image's parent node has only one child. Closes gohugoio#8362 Fixes gohugoio#10492 Fixes gohugoio#10494
bep
added a commit
to bep/hugo
that referenced
this issue
Dec 4, 2022
* Removes any surrounding paragraph nodes * And transfers any attributes from the surrounding paragraph down to the image node * Adds a new IsBlock field to the link context passed to the render hooks, only set for images. IsBlock is set to true if `wrapStandAloneImageWithinParagraph = false` and the image's parent node has only one child. Closes gohugoio#8362 Fixes gohugoio#10492 Fixes gohugoio#10494
bep
added a commit
to bep/hugo
that referenced
this issue
Dec 5, 2022
* Removes any surrounding paragraph nodes * And transfers any attributes from the surrounding paragraph down to the image node * Adds IsBlock and Ordinal (zero based) field to the image context passed to the image render hooks IsBlock is set to true if `wrapStandAloneImageWithinParagraph = false` and the image's parent node has only one child. Closes gohugoio#8362 Fixes gohugoio#10492 Fixes gohugoio#10494 Fixes gohugoio#10501
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
While working on #10493 I see that the template somehow needs to know if we're inline or not.
In HTML
img
is an inline element.figure
is a block element.Mot images in Markdown files is put in their own paragraphs and can be wrapped with a
figure
. But it's not possible to make that into a general rule.Not sure how easy this is, however.
The text was updated successfully, but these errors were encountered: