nicokaiser / hugo-theme-gallery

Gallery Theme for Hugo
https://nicokaiser.github.io/hugo-theme-gallery/
MIT License
336 stars 98 forks source link

Adding an image to the about page #36

Closed inezpereira closed 8 months ago

inezpereira commented 8 months ago

Hello there @nicokaiser !

First of all, thank you very much for creating this theme! I've just gotten started, and am having some trouble getting an image onto my about.md page.

I see you don' allow images in posts. Does that also apply to the about page?

Thank you!

nicokaiser commented 8 months ago

Bom dia @inezpereira! The theme is not really made for content other than galleries of images. However you can create posts (like the about page) and include images there – although these images need to be in your static folder (like /static/images/me.jpg). Then you can include them with something like

![Me](/images/me.jpg)

Unfortunately images cannot be alongside the posts ("page bundles"), otherwise these pages get rendered as galleries, which might not be what you want.

inezpereira commented 8 months ago

Bom dia, bom dia! 😊

I understand: focus on one goal, and that makes sense :)

Regarding the solution you suggested: I was trying what you sent me (see screenshots below), but I can't get it to work.

What the screenshots show:

  1. The line added to the about.md file
  2. The actual path to the image
  3. The result after running hugo server
image image image

I have tried:

Hm, what am I missing?

nicokaiser commented 8 months ago

Could you try

![Me](/images/me.jpg)

(without the /static) in the Markdown? /static is being stripped when building the site.

ethicalsnacker commented 8 months ago

I have suffering the same,

I have run with jpg, png.

Tried this in /public/images Tried this in the same folder alongside my .md

The image is viewed fine in the Markdown viewer in VSCode so would suggest a correct path.

nicokaiser commented 8 months ago

No, the Markdown viewer in VSCode will reference the wrong location. Images need to go in the /static folder, e.g. /static/images/foo.jpg and need to be referenced without the /static prefix, e.g. ![description](/images/foo.jpg).

inezpereira commented 8 months ago

It works! Thank you @nicokaiser ! :D