frjo / hugo-theme-zen

A fast and clean Hugo base theme with css-grid and Hugo pipes support.
https://zen-demo.xdeb.org/
GNU General Public License v2.0
264 stars 75 forks source link

How to center an image? #56

Closed bugok closed 2 years ago

bugok commented 2 years ago

First, thanks for working on this theme!

I was looking for a way to center an image from markdown. I'm not familiar with CSS, but I found that figure has something which seems like can be used for this: https://github.com/frjo/hugo-theme-zen/blob/2.x/assets/sass/_zen.scss#L169

Can you please explain how can I use figure to center the image?

Thank you!

bugok commented 2 years ago

Got it!

{{< figure src="my_image.png" class="center" >}}

(Got the idea from here: https://github.com/frjo/hugo-theme-zen#clear)

Thanks!

frjo commented 2 years ago

Glad you found the solution.

I use this theme as a base theme for all the sites I build. It is really not ment to be used as is. It works no problem, but the look is a bit boring to say the least.

bugok commented 2 years ago

Thanks for explaining! Do you have a github repo for such a site which is more advanced? I'd be happy to learn how to build on top of this theme.

frjo commented 2 years ago

Sorry no, all privat repos. But it just standard HTML and CSS, learn that and you can do anything.