rjoberon / bibsonomy-jekyll

BibSonomy plugin for Jekyll
GNU General Public License v3.0
7 stars 6 forks source link

Relative URL to downloaded PDF #4

Open raphaelmenges opened 5 years ago

raphaelmenges commented 5 years ago

Hello @rjoberon,

we are facing a minor issue when generating the references for the members of our team. It seems that the generated HTML code of the references links the to the downloaded PDF like href="pdf/paper.pdf", which causes the browser to prepend the link with the current folder in the URL, e.g., "/team/raphaelmenges/pdf/paper.pdf". However, the PDFs are located in the "pdf" folder at the root of the site directory. This might be fixed through prepending the generated, relative link with a slash, e.g., href="/pdf/paper.pdf".

Regards, @raphaelmenges

rjoberon commented 5 years ago

That's an interesting problem. The plugin currently only works for pages that are in the same directory as the document folder, i.e., it can not create a document folder in a subdirectory. Just appending / does not solve the problem, as then the plugin would not work for sites that do not reside at the root (/) of the web server's hierarchy (e.g., /~username/). Fixing this is nontrivial, as it requires careful distinction between the local path on disk during rendering and the path on the server. The changes required in the bibsonomy-ruby module would be incompatible with the module's purpose, as it is intended to work locally. Sorry, unfortunately I currently don't see how this could be fixed.

raphaelmenges commented 5 years ago

First of all, thank you for the fast replies :)

You may add an option in the _config.yml or the call parameters of {% bibsonomy ... %} to prepend a string to the links in the generated HTML code. This string could be forwarded to bibsonomy-ruby and simply put in front of the links.