Image in markdown not appearing

Hello!

First time Kirby user. I have everything working except for getting an image within the same folder to appear on the page.

The image is in the same folder (called about) as the .txt file. In the .txt file I have
(image: image.jpg) within a Body: field. In my template, I have
<?= $page->body()->kirbytext() ?> that is producing an image tag, though the path seems very off: http://localhost:8000/media/pages/about/f8f1fcf4e6-1601263720/image.jpg

No image is appears on the page however.
What am I doing wrong?
Thank you :slight_smile:

Welcome to the comunity :slight_smile:

This is actually how kirby works. It uses a media folder and copies your image to it. Amongst other reasons, this is so that you can do things like cropping and resizing without cluttering up the content folder or effecting the original image. When the file changes, that path will change.

1 Like

Does your server meet our requirements, in particular, is the gd library module installed and enabled?

If you look in the media folder, are the image files generated there?

1 Like

Thanks!

Your reply made me look at the media folder more closely. I saw there was no image being generated in there. It was a file permission issue.

In the docs, Kirby says to make folders with permissions 755. However, at that level for the media folder, it wasn’t writing so I changed it to 777 and all is well now. I never thought to change this according to the docs.

Thanks for the clue and clarification!

Even the media folder should not have 777 access rights. This folder is automatically regenerated by Kirby if it gets deleted.

Better look into file/folder ownership and leave permissions at 755.

1 Like