Streaming live at 10am (PST)

Is it possible to add Github Gists to CMS Rich Text?


#1

Trying to move my programming blog from wordpress to webflow. Ran into a snag - I can’t find any way to enable syntax highlighting for (python) code examples that are a part of nearly every post. Embedly has github gists which are perfect, but for whatever reason webflow’s rich media embeds don’t work for github.

Is this possible?

Let’s chat!

  • Dave

#2

Hi Dave,
I could surely assist you with this.
Please add me on skype:cis.am2 or drop me an email on anna.cis23@gmail.com to discuss further.
Hoping for prompt response.

Regards,
Anna


#3

Hey @davenovelli found a way to include gists to the Webflow CMS Rich text, blog about it as well

Let me know if it works for you.


#4

Thanks Anna, Mike sorted it all out!


#5

Mike you’re a total boss, thanks so much! The blog post was perfectly clear and as soon as I actually upgrade to the paid version I’ll know exactly what to do. I’ll ping you to confirm when it’s all wrapped up.

Cheers!
Dave


#6

glad I can help, I made a few tweaks to the code/stylesheet so the gists show up correctly on mobile. Let me know if you have any trouble and please do share your site :slight_smile:


#7

Hey Mike,

Unfortunately I’ve been unable to get it working. I’m seeing a javascript error in the console which I thought meant that I needed jQuery (I tried Core), but I added that and now I’m getting an error both in the script you provided AND in jQuery.

The initial error:

Uncaught ReferenceError: $ is not defined
    at using-category-encoders-library-in-scikit-learn:25

The additional error when I attempt to include jQuery before the tag:

Uncaught ReferenceError: define is not defined
    at core.js:5

My Share link is at: https://preview.webflow.com/preview/ultravioletanalytics?preview=3bf58d2f8abc2fe9edc411f69e45a374 if that makes it easier to track down?

Thanks again!


#8

Hey @davenovelli

Got your email, sorry for not responding earlier. Not sure what define is, I don’t call that function. Is it possible to share a staging version of the blog page with the gist code implemented?
Easier to see what’s happening that way


#9

Yeah, I think the second error “define is not defined” is being triggered by my attempt at including jquery rather than being part of your code.

Here’s a link to the staging site with the gist code implemented: http://ultravioletanalytics.webflow.io/blog/tf-idf-basics-with-pandas-scikit-learn

Thanks so much!


#10

Hey mate @davenovelli I had a look and it looks like the jquery function I’m using i.e. contains is only available in version 1.1.4. That could be the issue but I think it might be the code is being loaded in the head section of your site so jquery might not be available then, can you change it in webflow so it’s loaded right before the close </body> tag?


#11

Yeah!! That was it. I moved the code to the “before tag” section and it’s working like a champ. Thanks so much Mike!