Syntax highlighter gives more readability to blog posts while sharing code snippets. A lot of them are out there, but I'll walk you through the installation of `prism js` for blogger, in this post.
Prism js has multiple themes which you can try out all them here and you can pick one get css path from https://cdnjs.com/libraries/prism
Disclaimer: Take a backup of your blogger template as this post includes modifications to the blogger template, otherwise you might end up losing your template if you do any mistake.
We are adding CDN to blogger templates now, which includes a couple of javascript files and a CSS file. Javascript files are common in all installations but CSS files are different for each theme, check them here. I'm using tomorrow-night
Let's modify the template.
Let's modify the template.
Search for </head and add css path right above it.
Search for </body and add js path.
Great you installed it successfully. Now it's very easy to use every time you write a blog post without any extra effort.
Change post to HTML view mode put your snippet between <pre> tags and specify snippet language in class.
0 Comments