CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.22k stars 97 forks source link

The path to the image is not found #618

Open joergklein opened 1 month ago

joergklein commented 1 month ago

The path to the image is not found. In my Hugo project the images are located in /static/images/test.jpg, for example. I have a file in content/company/brand-guidelines.md. I would like to see an image on the pagefind search site. Here is the Markdown file:

---
title: "Brand-guidelines"
description: " Brand guidelines"
draft: false
slug: "brand-guidelines"
---

{{< row >}}
{{< column col-md-12 >}}

# first

<img data-pagefind-meta="image[src]" src="../images/test.svg" style="display:none" /> <- Error 404 at the page, but the image will be shown at the search page. 

## second

![test](/images/test.jpg) <- this works fine for the page, but the image will not shown at the search page.
{{< /column >}}
{{< /row >}}

The question is, how can I change the path to

<img data-pagefind-meta="image[src]" src="/images/gameboy.jpg" />

so that the error message no longer appears? The image is then displayed on the site and on the search page.