Ghost

How I got syntax highlighting working in Ghost

I found a blog that said how to get syntax highlighting to work. It almost worked. So, I summarized what I did.

How I got syntax highlighting working in Ghost

Mainly, I followed the instructions in this blog.

Instruction I took from the blog

  1. Add the following to the Blog Footer.
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.14.0/prism.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.14.0/components/prism-powershell.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.14.0/components/prism-csharp.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.14.0/components/prism-sql.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.14.0/components/prism-javascript.min.js"></script>
  1. Download your theme

  2. Download the Prism CSS from the customization page

  3. Update the CSS in your theme with the CSS from prism.

  4. Zip the theme

  5. Upload the theme to ghost and activate it.

Update 2018-02-02

I switched to a theme and editing steps 2-6 are not needed any more.

0 Comments 0 Comments
0 Comments 0 Comments