문제

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