Skip to content
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 an image via HTML #205

Open
seaveredge opened this issue Aug 26, 2024 · 1 comment
Open

Add an image via HTML #205

seaveredge opened this issue Aug 26, 2024 · 1 comment

Comments

@seaveredge
Copy link

seaveredge commented Aug 26, 2024

When I want to have an image, which is a float, such that it wraps around the text as (hopefully rendered correctly) in this issue.

However, if I try to do this in the .md file with the correct HTML code, it views it correctly in the VSCode editor (in terms of the markdown previewer, but when I build the website again, it does not show...

The code that I use (with example image):

<img style="float: right; margin: 0px 0px 15px 20px;" src="https://www.w3schools.com/Css/w3css.gif" width="40px">

When I inspect the element in the browser (at local host) it says <!-- raw HTML omitted -->. Is there a way to circumvent this?

PS. This is my first time opening an issue at a repository that is from someone I don't know. I hope this is the correct place to ask this, otherwise feel free to move this to another tab.

EDIT: Ok, the markdown is not rendered correctly in Github, but I hope you get the point. Thanks in advance anyway for considering my problem :)

@keesfluitman
Copy link

keesfluitman commented Dec 18, 2024

this is a general hugo thing to not render raw HTML.
I also use it sometimes, Depending on how you structure your config files.
If you have a _default folder, create a markdown.toml

[goldmark]
[goldmark.renderer]
unsafe = true

https://gohugo.io/getting-started/configuration-markup/#rendererunsafe

I've got the same issue with this theme. Im trying to implement the lightbox or a figure template, so they dont take so much space and are more dynamic. But the lightbox here isnt working. I can tell the js is loaded and does sth by debugging in developer tools in my browser, but the images dont actually change.
https://hugocodex.org/add-ons/lightbox/

So im looking for a way to add images in a more dynamic and prettier fashion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@seaveredge @keesfluitman and others