wjh18 / hugo-liftoff

Minimal blog/portfolio theme with a focus on content creation and SEO best practices. An ideal choice for technical users jump-starting a personal brand.
https://hugo-liftoff.netlify.app
MIT License
93 stars 27 forks source link

Insert image insie post #23

Closed pipMinder00 closed 1 year ago

pipMinder00 commented 1 year ago

I try to insert image and adjust the size of it with markdown as follow ![alt text](image URL){: width="50%"} but not work I tried as well HTML tag img not worked, any suggestion ?

Thanks in advance

wjh18 commented 1 year ago

You should be able to add CSS classes to images in markdown with URL fragments in the markdown image URL. This is processed via the image markdown render hook in hugo-liftoff/layouts/_default/_markup/render-image.html.

![alt text](image.png#class)

Then in assets/custom.css in your project:

.class {
    width: 50%;
}

Alternatively you could use a figure shortcode and add a style or class attribute from there.

pipMinder00 commented 1 year ago

that works! thank you