boyney123 / eventcatalog

Discover, Explore and Document your Event Driven Architectures powered by Markdown.

Home Page:https://eventcatalog.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Adding local images does not work

hffmnn opened this issue · comments

Have you read the Contributing Guidelines on issues?

Description

When trying to show a local image by adding it's path to a markdown file, it doesn't get rendered/added to the output.

Steps to reproduce

  1. Write you e.g. service documentation
  2. Add a image to you service directory e.g. .../NotificationService/infrastructure.png
  3. Add the image to the index.md file via `Infrastructure overview

Expected behavior

It renders the image in dev and production builds.

Actual behavior

It renders the alt text, but no image is shown.

Your environment

  • EventCatalog version used: 0.6.8
  • Environment name and version: Firefox 115.0
  • Operating system and version: macOS Ventura 13.4.1

Did you try adding the image to the public directory? We have images in our documentation and it works fine. For example, in our event (index.md) documentation we have this:

  • File: eventcatalog/domains/Example/events/ExampleEvent/index.md
Status flow:
<img alt="header" src="/assets/ExampleEvent/status_flow.svg" />​

And then we created an assets directory inside the public directory, and added the image there:

  • File: eventcatalog/public/assets/ExampleEvent/status_flow.svg

Hi @rafaelrenanpacheco

thanks for your support. It tackled it again today (knowing now that it somehow has to work) and now it does :)
The solution was a combination of different things:

  • I used the markdown image syntax (![Alt Text](link to image)) which doesn't seem to work at all
  • We changed the basePath prop in eventcatalog.config.js so for us the src prop is sth like /<basePath>/assets/some_image.png

Thanks again for your support