Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No proper rendering for <script>-embedded codes #6

Open
voigt opened this issue Oct 4, 2013 · 11 comments
Open

No proper rendering for <script>-embedded codes #6

voigt opened this issue Oct 4, 2013 · 11 comments

Comments

@voigt
Copy link

voigt commented Oct 4, 2013

Sorry, I couldn't find a proper title...

I just found out, that e.g. embedded GitHub Gists would not work, hence they are not gonna be rendered after the ajax call:

<script src="https://gist.github.com/usr/xxxxx.js"></script>

Is there a possibility to force rendering after getting the post?

I found out, that e.g. Youtube embedding works fine...

Regards,
Christoph

@pacuna
Copy link

pacuna commented Nov 21, 2013

I'm having the same problem. I'm using highlight.js for mi code snippets and when the syntax doesn't work after the ajax call

@rastating
Copy link

I am also getting this problem.

@javaguirre
Copy link

I had the same problem with prettify, the AJAX load doesn't tell the js plugin to rehighlight the post, so It's not done.

A quick and dirty hack is adding the highlight/prettify script in post.hbs for now, or call the highlight js object when a new post is loaded on post.hbs (see below).

Something like this for hljs in post.hbs.

<script type="text/javascript">
  hljs.configure({classPrefix: ''});
  hljs.initHighlightingOnLoad();
</script>

@zvolkov
Copy link

zvolkov commented Apr 13, 2014

Same here. Problems with Disqus due to AJAX.

@rastating
Copy link

@zvolkov what problems are you having with Disqus? I managed to get it working in my fork OK. If I remember correctly all I did was edit post,hbs with the code you can see at the bottom of it. Fork is here: https://github.com/rastating/ghostwriter

Hope that helps

@zvolkov
Copy link

zvolkov commented Apr 13, 2014

@rastating open dev tools / console, and see if you get errors when AJAX-navigating to "browse posts" and then to an individual post. Disqus does not seem to like being loaded by jquery.get multiple times. Because Disqus breaks, javascript execution is aborted, so my highlight.js script that follows Disqus won't run. I ended up getting rid of AJAX navigation and restructuring the index page to show multiple posts. See at http://zvolkov.com/clog

@roryg
Copy link
Owner

roryg commented Apr 17, 2014

Have a look at https://bensmann.no/dynamically-embedding-gists/ and http://help.disqus.com/customer/portal/articles/472107-using-disqus-on-ajax-sites for getting Github Gists and Disqus to work with the themes AJAX navigation. I've thought about including this functionality with the theme but it seems like it could be unnecessary bloat for most users.

@arfon
Copy link

arfon commented Aug 3, 2017

I've thought about including this functionality with the theme but it seems like it could be unnecessary bloat for most users.

Please consider doing this. I love the theme but not having Gist embed functionality is kind of a deal breaker for me.

@javaguirre
Copy link

javaguirre commented Aug 3, 2017

Couldn't it be something optional using a configuration flag to enable it, disabled by default?

@roryg
Copy link
Owner

roryg commented Aug 3, 2017

@javaguirre possibly

@arfon I've been thinking about rebuilding the theme using ReactJS, if I do I'll make sure to try and include support for things like PrismJS. Unsure of when I'll get around to it though...

@arfon
Copy link

arfon commented Aug 3, 2017

@arfon I've been thinking about rebuilding the theme using ReactJS, if I do I'll make sure to try and include support for things like PrismJS. Unsure of when I'll get around to it though...

❤️ thanks. Totally understood that we're all in this thread asking you to do work for us 😄.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants