My code card is not highlighting properly

  1. I am using the cloud hosted version of Ghost
  2. I have added prism 1.16
  3. the python code shown up in the preview page of my draft doesn’t show any highlights

for prism js you need to mention the language. Write as below and see what happens

```python
//your code here
```

I did and in the preview that’s what I got.

It would help if you could explain exactly what you’ve done here so that someone is able to help you - without knowing what you’ve done and with no link to your site the only thing anyone can do is guess at possible problems.

Hi Kevin,

Thanks for reply.

  1. I have published the draft post so that everyone can see it. https://djangoforhumans.com/generic-relation-django-rest-framework/

  2. This is the admin view of the post where I created the code card

  3. This is the header and footer where I added the prism.js

In Site Header
<link rel="stylesheet" type="text/css" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.16.0/themes/prism.min.css"/>

In Site Footer
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.16.0/prism.min.js"></script>

Python is not one of the default supported languages in Prism.js. You’ll need to link to the python language JS support file in addition to the core prism JS file.

Hi there,

I eventually figured out how to make it work via this article https://blog.checkyo.tech/2018/06/26/easy-code-highlighting-in-ghost-with-prism/

Thank you. I will close this.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.