Mangled base url on localhost/gravsite/


#1

![my pic](mypic.jpg) -> http://localhost/mypage/mypic.jpg
when it should be
![my pic](mypic.jpg) -> http://localhost/gravsite/mypage/mypic.jpg

The custom base url config seems to be standing for something else, how to fix this?

Probably doesn’t matter, but I used this skeleton, when stumbled on this problem using the above syntax on standard page: https://github.com/hibbitts-design/grav-skeleton-open-publishing-space


#2

@obeliksz In a fresh install of ‘Open Publishing Space’ skeleton from the download section of https://getgrav.org/downloads/skeletons:

  1. I created a new folder ‘/user/pages/06.mypage’ containing file ‘default.md’ and ‘mypic.jpg’
  2. Added the link ![my pic](mypic.jpg) to ‘default.md’.
  3. Browsed to ‘http://localhost/site-publishing/mypage

The link gets translated into:

<img alt="my pic" src="/site-publishing/user/pages/06.mypage/mypic.jpg">

Copying the url in the browser gives http://localhost/site-publishing/mypage/mypic.jpg, which displays the image correctly.


#3

@pamtbaau Thanks for checking it out again, checked it, if I put my folder to a new gravsite it works as expected. I have no clue what kind of configuration mistake could be causing this. I have checked my configurations and I couldn’t find a configuration change that could cause this.


#4

@obeliksz Oh well, there are so many yamls, with so many properties, that mistakes can happen easily.


#5

@pamtbaau, got it: after I remove the Img Captions Plugin by @OleVik it gets back to normal.


#6

That is odd, the plugin should take base URL into account when parsing images. I’ll make a mental note to check out why.