Вопрос

I'm running an installation of Ghost and am trying to include a Google Charts chart into a single post. Doing so would however require me to load Google's javascript first.

This should of course be possible by adding the <script> tag to /content/themes/casperdefault.hbs, but I'd rather not load it globally, but just if necessary on a per-post basis.

Is this in any way possible? Adding the code directly into the post body at least doesn't seem to have much of an effect.

Thanks!

Это было полезно?

Решение

Adding a script tag in the post body in the editor should in fact work. In Ghost 0.4, the following results in an alert box with object:

<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.3.0/handlebars.min.js"></script>
<script>alert(typeof window.Handlebars)</script>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top