Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

Mangled base url on localhost/gravsite/

Solved by z-aszlo View solution

Started by z-aszlo 8 years ago · 5 replies · 878 views
8 years ago

![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

last edited 07/23/18 by z-aszlo
8 years ago

@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:

TXT
<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.

8 years ago

@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.

8 years ago

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

8 years ago Solution

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

8 years ago

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

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 8 months ago
6 94 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 184 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 146 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 60 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 254 1 year ago