Add inline image in text
stalkerGH opened this issue · 6 comments
I asked on general Zola board (https://zola.discourse.group) but maybe I can try here too.
I’d like to add small inline image, directly in text. If I add tag directly in .md file, it renders as separate paragraph:
first part of text
IMAGE
rest of text
But I’d like to have it like this: “some text IMAGE and some text again”.
How (and if) can I achieve that in Zola & Tabi?
It wasn't possible with tabi's CSS. I've added (6a4f424) a new class for images, inline
, which allows you to do this.
To use it, you'll need to specify the inline
class on the image. To embed the image, use HTML:
Some text <img src="path/to/img.png" class="inline" alt="Descriptive text"> and some more text.
I've made it so the image gets vertically aligned with the text, hoping that fits most use cases for this class.
Let me know whether that helps.
As to why I made all images centered and in a new line: I want centered images on my posts. So far, I haven't had to use an inline image. In choosing a default, I chose the one I saw most use for. Making inline images the default (which it is without CSS) would make adding centered images more cumbersome.
Hope that makes sense!
Thank you very much! Yes, it works like a charm. Little change in the code but great effect :)
The problem is solved so I close the issue.
@stalkerGH if you're interested, now you can use all image shortcodes with the inline
option (#315)
Yes, indeed I'm interested. Thank you for this new feature :)
Thank you for the idea!