Note on Highslide - Override hs.graphicsDir

After posting that I had a cool new thumbnail viewer, that was super easy to use, I ran into an issue. The viewer wasn’t working within sub-directories, which is a big deal considering that every post generated by Jekyll gets dumped into a sub-directory.

The issue turned out to be that, by default, the Highslide API assumes to be in the same directory as the HTML file attempting to use it. When this is not the case, it breaks. Though the solution took some digging, and isn’t obvious at all, it is pretty easy to fix. You just need to override hs.graphicsDir to point to the actual location of the API. Here’s a snippet:

<script type="text/javascript" src="/highslide/highslide.js"></script>
<script type="text/javascript">
    hs.graphicsDir = '/highslide/graphics/';

So much for being plug-and-play easy. I still think it was a relatively painless setup and will be a nice addition to the site. I look forward to utilizing it.