scragg0x / realms-wiki

Git based wiki inspired by Gollum
http://realms.io
GNU General Public License v2.0
833 stars 90 forks source link

Images and other assets with relative paths #46

Open loleg opened 9 years ago

loleg commented 9 years ago

If you (like me, due to re-publishing needs) use relative paths to images in your wiki, you may notice that they (1) break in the editor due to the /_edit/ URL scheme. This is similar to travs/markdown-pdf#8. They also (2) needlessly appear in the Index, along with files like .gitignore.

Is there a preferred development route to resolve this, or are users advised not to store assets in their wiki repo?

loleg commented 9 years ago

An easy workaround for (1) if you're using a web server to proxy the wiki is to rewrite the path, e.g. like this in nginx (assuming assets are stored in an /images/ subfolder):

location ^~ /_edit/images/  {
 rewrite ^/_edit(/.*)$ $1 last;
 root /opt/realms/wiki;
}