GhostJS - How to use external JavaScript libraries with custom HTML markup on your ghost blog platform

Sometimes on your Ghost blog platform you might want to add some extra capabilities like writing actual HTML markup to format your post or even some JavaScript to make it bit fancy.

Fortunately, it is very straight forward with GhostJS. The markdown allows you to have HTML markup. Yes that is right you can type anything and it won't be escaped.

So little while ago I created an interactive calculator for kite surfers. So I thought some of you might find it useful.

First: Make sure that you have RequireJS loaded in your page header. You can do that through under Settings -> Code Injection . See image below:

The code below is the source of page mentioned above to generate the graph. Its using the following javascript libraries:

  1. jQuery
  2. d3
  3. nvd3

Sid Dahari

I'm a Full stack web developer passionate about programming languages, web technologies and operating systems with vocation for open source & clean code. I'm also a big fan of kitesurfing.

St Kilda, Melbourne, Australia
comments powered by Disqus