Path of the images defined in Front Matter

Hi. I usually add the images of my posts within the same folder. The issue happens when I define the images in the Front Matter.

---
title: "My Post"
images:
- image1.jpg
- image2.jpg
---

The url of my post is https://example.org/my-post/ but then OpenGraph links the images like https://example.org/image{1,2}.jpg.

Is there a way to fix the url besides adding it manually to the Front Matter?
Instead of:

---
title: "My Post"
images:
- my-post/image1.jpg
- my-post/image2.jpg
---

Having something like:

---
title: "My Post"
images:
-  {{ "image1.jpg" | relURL }}
-  {{ "image2.jpg" | relURL }}
---

What are my options?

Have a look at Page Resources.

You can try pattern matching to get a reference to the image as a resource, then get the permalink that way.

Hi @pointyfar Thanks. Unfortunatelly the pattern matching feature works only for resources, and not for my usecase. :pensive: