claudioc / jingo

Node.js based Wiki
MIT License
1.02k stars 184 forks source link

wrong url for image in the preview page #153

Closed xu4wang closed 7 years ago

xu4wang commented 8 years ago

I put a picture in the git repo under assets directory, and put below in the markdown page "sandbox.md" for testing:

![payer1](assets/payer1.jpg)

The picture is displayed in the sandbox page, and I noticed the piture URL is correct:

http://wiki.somedomain.com/wiki/assets/payer1.jpg

However, If I preview the sandbox page during editing, the picture is not displayed, and the URL is:

http://wiki.somedomain.com/pages/sandbox/assets/payer1.jpg

I think there is something wrong during preview?

Thanks, Xu

claudioc commented 8 years ago

Thanks, this looks like a bug! I will fix it

JSteunou commented 7 years ago

It comes with the fact that you're using relative urls for your image

@claudioc 3 ways to solve this

JSteunou commented 7 years ago

@xu4wang if you use /wiki/assets/payer1.jpg you will not be bothered anymore

JSteunou commented 7 years ago

@claudioc I edit my first post, I got some paths wrong.

claudioc commented 7 years ago

@JSteunou @xu4wang I just wrote a wiki page to describe the problem and the solution :)

Thanks to you both!

https://github.com/claudioc/jingo/wiki/add-images-to-the-Jingo-own-repository