1

I try to load prism.js in my ghost. I've forked this repo which is not supporting the new ghost 1.x verions. I've updated the tags so I'm able to load the layouts but I'm still unable to load prism.js.

In default.hbs:

{{> loaders/load-prism}}

In partials/loaders/load-prism.js (here I want to load prism.js and prism.css)

<script>
  (function() {
    var l = document.createElement('script'); l.type = 'text/javascript'; l.async = true;
    l.src = '{{asset "lib/prism/prism.js"}}';
    var h = document.getElementsByTagName('head')[0]; h.appendChild(l, h);
  }());

  var highlightAll = function() {
    Prism.highlightAll();
  };

  window.addEventListener('load', highlightAll);
</script>

And of course I've download my prism.js and prism.css. It's in assets

/lib/prism/prism.js and prism.css
Haukinger
  • 10,420
  • 2
  • 15
  • 28
DenCowboy
  • 13,884
  • 38
  • 114
  • 210
  • Did you also include the CSS file? The code to include the JS looks correct, when you say "unable to load" what do you mean specifically? Is there a 404 in the network console? – ErisDS Feb 13 '18 at 09:54

0 Answers0