boratanrikulu / eternity

A minimalist Hugo theme designed for portfolio sites.
https://eternity.bora.sh
MIT License
237 stars 78 forks source link

Want to add images in about.md with markdown #69

Closed PhilEndr closed 9 months ago

PhilEndr commented 1 year ago

Hi, first of all great theme!

I want to add images to a post (in this case the about.md file) other than using the images array provided in the header. My goal is to integrate images in the text.

I used the following without success:

![Alt text](../assets/images/banner.png)
{{< figure src="../assets/images/banner.png" title="banner" >}}
<img src="../assets/images/banner.png">

I tried using absolute path, relative path. When I am using an image from arandom source from the internet the image is rendered. However, if I try using an image like the already existing banner.png rendering fails?

What am I doing wrong? ;)

BR and Thx Phil

olwenya commented 12 months ago

@PhilEndr

Files in the asset folder are processed by hugo and renamed. Look at the example below in my public folder

public/images
├── about_hucad548a36c746548e4169d30041223ab_460485_3000x0_resize_box_3.png
├── about_hucad548a36c746548e4169d30041223ab_460485_800x418_fill_box_center_3.png
├── banner_hu3e75864d8ed91e38e53620f375b9d21f_93854_800x418_fill_box_center_3.png <<==== banner renamed

I referenced the image like this in markdown and it worked

![alt text](/images/banner_hu3e75864d8ed91e38e53620f375b9d21f_93854_800x418_fill_box_center_3.png)

I'm not sure that the filename would be constant between builds. I suggest making copies of the images and adding them to the static and referencing them from there.

Images in static will not be touched in builds.

boratanrikulu commented 11 months ago

Hi @PhilEndr, do you still have that issue?

schnaxelhubr commented 11 months ago

it is also important to say, to create a corresponding subfolder in static for the page - and put the pictures in there

boratanrikulu commented 9 months ago

[!WARNING]
This project is currently not being actively maintained.
Please do not create new issues on GitHub.