Images management in a hugo website

Hello there !

My post was first about the fact that Hugo used the /layouts/_defaults/ HTML files for the build, but I finally spotted my mistake. So I edit this post to ask some advices about images management.
It is great to write articles using only Markdown, I love this ! But when it comes to insert pictures in a post, I only know the ![image]image_url.jpg tag.
I’m lost when I want to do something more : where do I have to work if I want to display some pictures in thumbnails ? Thumbnails with a link to the fullsize picture ?
I tried to center a picture but Hugo puts it in a <p> tag and the CSS margin: auto; doesn’t work, and I can’t find any selector to apply a property to the <p> tags which contains <img> tags…

Well I’m lost, and since I’m new in Hugo, I tried to understand the Docs but it doesn’t helps me, actually I don’t even understand where I can add some of the codes in the page… So I’m here to ask you advices !

Thanks a lot,

M.

for example : You can see in this page that the image is not centered. Hugo automatically place it in a <p> tag and I don’t know how I can manage the images display (centered ? thumbnail ? thumbnail + link to full size ?). I read the doc but it’s hard to understand.

you can use shortcode to embedd images {{< figure ... >}} There is a search function :wink:

To center the image you have to use CSS or embeded styles.

I use a template gallery to show all pictures in sub-folder gallery

Sample is here

PS: I use tachions CSS and fancybox

Thanks for your answer, I can tell you I used the search function, and nothing made sense to me.
Since I’m quite new in Hugo, how could I guess the shortcode you mentionned could be useful ? I didn’t even know it exist ! And I’ve spent many hours on discovering hugo and how it works…

Thanks to you, I know I can look in that direction (and explore “shortcodes”…). I know it’s a very basic question, but I felt I was stuck, without any clue about where to look for. As I mentioned before, I tried to search for “image”, “picture”, in this forum and in the doc, but I didn’t understand everything… I’m french, maybe that’s why I’m a little bit lost in a foreign language on a foreign platform ^^

Thanks, I will now explore !

Back here… For a reason I can’t explain, shortcode is not processed.

deuxieme-article.md :

+++
date = "2019-09-14T01:57:29+02:00"
title = "Deuxièèèème Article"
type = "article"
draft = false
+++

Lorem ipsum summary of the article.
<!--more-->
Lorem ipsum rest of the article.
ET LOL

{{< figure src="/macron.jpeg" >}}
{{ figure src="/macron.jpeg" }}

The result (via hugo server) :

Do you understand how is it possible ?

Maybe is there an option to enable shortcodes ? Or something I’ve done that disable them ?

The page : https://compassionate-ardinghelli-6472ed.netlify.com/articles/deuxieme-article/
My repository : https://gitlab.com/mathieunicolas/website

{{< figure src="/macron.jpeg" >}} works for me:

I cloned the repo and edited that article to be:

+++
date = "2019-09-14T01:57:29+02:00"
title = "Deuxièèèème Article"
type = "article"
draft = false
+++

Lorem ipsum summary of the article.
<!--more-->
Lorem ipsum rest of the article.
ET LOL

{{< figure src="/macron.jpeg" >}}

You need to read all the docs. I expect everyone posting here to have read all the docs. :slight_smile:

Thanks for your answer !
I read the docs sir, I’ve read the docs during at least 6 hours the last 2 days.

The reason why it didn’t work, thanks to your comment, is that I use Ulysses to edit my MD files, and it automatically replaces < and > with \< and \>. I didn’t spot the mistake, and this kind of error is not in the docs. There was no reason the error was in my MD file since I made some copy/paste from the docs and just updated the file path.

Thanks

next step to read :wink:

beaucoup de succès

Haha, thanks for the advice !
I’ve come to this page few times, not sure about what I understood… I’ll try one more time this afternoon !

Thanks for your kind message, sir !