gokarna-theme / gokarna-hugo

A minimal opinionated theme for Hugo
https://gokarna-hugo.netlify.app
GNU General Public License v3.0
357 stars 139 forks source link

customize image alignment #253

Closed k4lizen closed 1 day ago

k4lizen commented 1 week ago

Currently in posts images are center aligned. I'd much prefer if they were left aligned since thats how they are in other software I use for viewing .md files.

Is there a way to do this?

yashmehrotra commented 1 day ago

You can add custom css rules in your config.toml using params.customHeadHTML, example:

[params]
  customHeadHTML = "<style>color: red</style>" (or)
  customHeadHTML = "<link rel='stylesheet' type='text/css' href='hosted-css.link'>"

https://gokarna-hugo.netlify.app/posts/theme-documentation-basics/#custom-head-html

k4lizen commented 1 day ago

Oh I didnt think of that, thanks. This seems to work:

.post.container img {
  display: block;
  margin-left: 0;
  margin-right: auto;
}